I am stumped as to how to understand when my EFS runs . I am trying to build a trading system that runs live at the end of every bar but does not generate signals while the EFS is loading . What I have done is this :
- I set the preferences for all EFS to run at the close of a bar .
- In my code I check for signals when getBarState == BARSTATE_CURRENTBAR
I then expect my signal code to run at the end of every bar . Well nothing happens . I remove the BarState check and things run but I get the unwanted side effect of getting stale signals firing .
I changed the check to BARSTATE_NEWBAR and things start to work but I thought NEWBAR was only used at the beginning of a bar and not at the end of the bar where I want my code to run .
Have I mis-understood the use of getBarState .... .
I want to remove the preference to have all EFS run at close of bar as I have a tick counter that displays on my chart . What is the most robust method to have a single EFS only run at bar close without this preference checked ?
On a side note I recall at one time seeing a tick counter for the bar in the Cursor window . I coul duse that if it is available but I don't recall how to set it up .
Thanks for your help and reading my ramblings
- I set the preferences for all EFS to run at the close of a bar .
- In my code I check for signals when getBarState == BARSTATE_CURRENTBAR
I then expect my signal code to run at the end of every bar . Well nothing happens . I remove the BarState check and things run but I get the unwanted side effect of getting stale signals firing .
I changed the check to BARSTATE_NEWBAR and things start to work but I thought NEWBAR was only used at the beginning of a bar and not at the end of the bar where I want my code to run .
Have I mis-understood the use of getBarState .... .
I want to remove the preference to have all EFS run at close of bar as I have a tick counter that displays on my chart . What is the most robust method to have a single EFS only run at bar close without this preference checked ?
On a side note I recall at one time seeing a tick counter for the bar in the Cursor window . I coul duse that if it is available but I don't recall how to set it up .
Thanks for your help and reading my ramblings
Comment