I am tracking my strategy PnL and its commissions for the current trading day. The idea is that once it hit above a certain threshold after a position is closed, then the strategy pause to take new trades for the current day. I saw that we have SystemPerformance.RealTimeTrades can help me calculate current trading PnL and commission. However, will SystemPerformance.RealTimeTrades work in Strategy Analyzer as strategy analyzer use historical data. Can you confirm that SystemPerformance.RealTimeTrades works the same way in Strategy Analyzer as when the strategy runs in realtime?
//calculate total netprofit and commissions if (SystemPerformance.RealTimeTrades.Count > 1) { Trade lastTrade = SystemPerformance.RealTimeTrades[SystemPerformance.RealTimeTrades.Count - 1]; DailyRealizedPL = DailyRealizedPL + lastTrade.ProfitCurrency; DailyCommission = DailyCommission + lastTrade.Commission; } if (DailyRealizedPL <= -1*Risk_per_trade*3 || DailyRealizedPL >= (Risk_per_trade*2*2 + DailyCommission) ) return; // stop looking for new entry.
One other question: is Trade object a Position? Say if I open a long position with 5 contracts, then sell 4 contracts and keep 1. Later I close the position after selling the last contract. The position is closed. Does Trade object give the net PnL of the closed position?
Comment