The last trade in a backtest always closes with "Exit on Session Close".
Can you please let me know how I can check if the last trade really was the last trade of a backtest and then do something, for example perform a final custom calculation and print to Output window?
If Time[0].Date == To.Date, && ... do something, does not (always) do the trick, since the End Date entered by the user can be a Saturday, Sunday or a public holiday.
If Time[0]Date >= To.Date && whatever ... doesn't work either, since the Backtest will already have stopped at that point in time.
How does NT itself determine that it has to close the last open position on let's say Friday Sept 21, 2018, if the user runs a backtest until Sunday Sept 23, 2018?
Thanks for letting me know.
Regards
NT-Roland
Comment