ran a backtest - showed 1 or 2 trades for the same time
ran a replay - 0 trades
put it thru debugger on replay.. conditions were not met. After wrestling with it, here is what I found.
a bit of a background:
barsinprogress 0,1,3,4..8 on primary instrument
barsinprogress 2 on secondary instrument.
bip 0,3,4..8 call Closes[2][0] which updates regularly in backtest. When script executes on historical data on the chart (in live/replay) it updates until the last but one bar which is about right.
But when transitioning to live/replay data (actual replay starts), Closes[2][0] stops updating and same value (last but one bar close of secondary instrument's historical data on chart) is returned through out (live/replay bars) and hence conditions never triggered. Consequently, no trades in live/replay.
On the replay chart, I see both instruments moving but the output remaining stagnant for Closes[2][0] when called from primary instrument' bip.
This is perhaps maybe due to the way bars are calculated (backward to forward) during the transition from historical to current data. Someone needs to fix Closes array.

Comment