I am currently using "ATM Strategy" to place buy/sell orders within my strategy.
AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
I am trying to get the cumulated realized profit, but could not get using the below code from the "Sample PnL" in the reference section.
if (Bars.IsFirstBarOfSession)
{
// Store the strategy's prior cumulated realized profit and number of trades
priorTradesCumProfit = SystemPerformance.RealTimeTrades.TradesPerformance .Currency.CumProfit;
/* NOTE: Using .AllTrades will include both historical virtual trades as well as real-time trades.
If you want to only count profits from real-time trades please use .RealtimeTrades. */
}
CumProfit = SystemPerformance.RealTimeTrades.TradesPerformance .Currency.CumProfit - priorTradesCumProfit;
Please help.

Comment