1. The value Closes[x][0] is the value for data series X at the close of the last COMPLETED bar in the data series X (not the current value of the bar in progress).
2. A bar is not completed until the NEXT bar opens for that instrument.
So here's my problem. I have data series ABCD as my secondary data series. It includes the following sequential minute bars (only closing values shown below).
8/4 15:58; 395.6500
8/4 15:59; 395.6000
8/5 02:00; 395.1000
Now, according to rules 1 & 2 above, on 8/4 16:02 the value of Closes[1][0] should be 395.6500 since the last completed bar would be the 15:58 bar above. And indeed, that is the value for Closes[1][0] when I run a historical test up to 8/5. However, if I instead run the historical test to 8/6, the value of Closes[1][0] at 8/4 16:02 becomes 395.6000.
The strategy analyzer seems to be inappropriately closing a bar prior to the open of the next bar. It does this when it sees a future bar in memory. This seems to be a serious issue, since in real-time it would not be able to see that future bar to close out the current bar. In the example above, the 15:59 bar should not close until 8/5 02:00.
Please help me on this issue. Thank you.
Comment