If I use setComputeOnClose(), the actual bar indexes seem to get offset back by one.
Normally, I expect the current bar to always be the (0) bar and the previous one to be (-1), etc. That doesn't seem to be the case when using setComputeOnClose() and the bar indexes seem to get offset back by one.
If I ask for debugPrintln(close(-1)+" "+close(0)) whenever we have a BARSTATE_NEWBAR, the (0) values print for the currently forming bar. If I add setComputeOnClose() in premain, the (0) values print for the prior bar and ignore the currently forming bar.
I didn't expect this. Is this correct? Thanks.
Normally, I expect the current bar to always be the (0) bar and the previous one to be (-1), etc. That doesn't seem to be the case when using setComputeOnClose() and the bar indexes seem to get offset back by one.
If I ask for debugPrintln(close(-1)+" "+close(0)) whenever we have a BARSTATE_NEWBAR, the (0) values print for the currently forming bar. If I add setComputeOnClose() in premain, the (0) values print for the prior bar and ignore the currently forming bar.
I didn't expect this. Is this correct? Thanks.
Comment