[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Performance.RealtimeTrades.GetTrades(<Instrument>,<EntrySignal>,[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]).TradesPerformance.Currency.AvgProfit ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Works for LONG during trade, but not for SHORT. Does not always work after trade ends.[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Performance.RealtimeTrades[n].Commission ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Works for both after trade ends.[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Performance.RealtimeTrades[n].ProfitCurrency ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Does not work for LONG or SHORT after trade ends.[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Performance.RealtimeTrades[n].ProfitPercent ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Does not work for LONG or SHORT after trade ends.[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Performance.RealtimeTrades.TradesPerformance.Currency.CumProfit ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Works for both after trade ends.[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Positions[n].GetProfitLoss(<MarketPrice>,PerformanceUnit.Currency) ;[/SIZE][/FONT] [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// Works for both LONG and SHORT during trades, but not after trade ends.[/COLOR][/SIZE][/FONT] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]
How can one absolutely reliably, and as simply as possible, obtain realtime trade PnLs as Currency for individual trades during the trades and after the end of trades for both LONG and SHORT?
Thanks!
Comment