found here: https://ninjatrader.com/support/help...collection.htm
protected override void OnBarUpdate()
{
// Accesses the first/last trade in the strategy (oldest trade is at index 0)
// and prints out the profit as a percentage to the output window
if (SystemPerformance.AllTrades.Count > 1)
{
Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1];
Trade firstTrade = SystemPerformance.AllTrades[0];
Print("The last trade profit is " + lastTrade.ProfitPercent);
Print("The first trade profit is " + firstTrade.ProfitPercent);
}
}
I do not get any print statements after the strategy makes a trade.
I am trying to get the realized PnL that is displayed when you view the strategy under the Strategies tab.
Comment