It's working when applied to the chart.
For some reason, I need it to work on the strategies tab.
if (SystemPerformance.RealTimeTrades.Count > 0)
{
// Check to make sure there is at least one trade in the collection
Trade lastTrade = SystemPerformance.RealTimeTrad es[SystemPerformance.RealTimeTrades.Count - 1];
// Calculate the PnL for the last completed real-time trade
double lastProfitCurrency = lastTrade.ProfitCurr ency;
// Store the quantity of the last completed real-time trade
double lastTradeQty = lastTrade.Quantity;
// Pring the PnL to the NinjaScript Output window
Print("The last trade's profit in currency is " + lastProfitCurrency);
// The trade profit is quantity aware, we can easily print the profit per traded unit as well
Print("The last trade's profit in currency per traded unit is " + (lastProfitCurrency / lastTradeQty));
}
Any workaround, please.
Your help would be much appreciated!
Thanks
Comment