My question seems to be along the same lines of this trend, so I'm posting it here.
I have a EFS study that has setComputeOnClose() in the preMain(). In this same study, I want it to wait till all bars have loaded before running. In this situation I use this statement:
if (getCurrentBarIndex() != -1) {return;}
First question, is this the best way to do this or is there something else?
Second question: on a TICK chart, the above statement seems to work fine (on the initial loading of the chart). However, if I drag the chart over to view past bars that causes the chart to load more historical data, my EFS keeps running during this loading of data. I do not want that. I want my EFS to wait while this additional data is loading. How can I do that?
I tried the following, but it didn't seem to work:
if (getBarState() == BARSTATE_ALLBARS) return;
Any help is greatly appreciated!
Thanks!
Daniel
I have a EFS study that has setComputeOnClose() in the preMain(). In this same study, I want it to wait till all bars have loaded before running. In this situation I use this statement:
if (getCurrentBarIndex() != -1) {return;}
First question, is this the best way to do this or is there something else?
Second question: on a TICK chart, the above statement seems to work fine (on the initial loading of the chart). However, if I drag the chart over to view past bars that causes the chart to load more historical data, my EFS keeps running during this loading of data. I do not want that. I want my EFS to wait while this additional data is loading. How can I do that?
I tried the following, but it didn't seem to work:
if (getBarState() == BARSTATE_ALLBARS) return;
Any help is greatly appreciated!
Thanks!
Daniel
Comment