I would like to draw the PNL and the number of trade made by my strategy directly on the chart.
i wrote this simple script on the OnBarUpdate() but nothing happen, can you help ?
if (State == State.Realtime)
{
// Text to draw
string tradeCountText = "Trades: " + SystemPerformance.AllTrades.Count;
string pnlText = "PnL: " + SystemPerformance.AllTrades.TradesPerformance.NetP rofit;
// The information on the line
string displayText = tradeCountText + "\n" + pnlText;
// Draw above the candle
Draw.Text(this, "TradeStats", displayText, 0, High[0] + TickSize * 10, Brushes.Blue);
}

Comment