I have an EFS script in which I want to grab an indicator value on the 1st tick of a new bar. My script uses:
if(getBarState()==BARSTATE_NEWBAR) {
do_some_stuff }
This doesn't work for me (under esignal v7.8 7.7 or 7.6). What I do inside the curly brackets is to grab the indicator value and print it to the alert list along with the (getCurrentBarIndex) value and the time.
What happens is that it waits until the first new tick of a newbar, then returns the indicator value of the previous bar (based on the time I print out and the barindex being -1.
What is wrong with this??? Every single piece of example code says to use BARSTATE_NEWBAR to get the first tick of new bar but this definately doesn't work for me!!
if(getBarState()==BARSTATE_NEWBAR) {
do_some_stuff }
This doesn't work for me (under esignal v7.8 7.7 or 7.6). What I do inside the curly brackets is to grab the indicator value and print it to the alert list along with the (getCurrentBarIndex) value and the time.
What happens is that it waits until the first new tick of a newbar, then returns the indicator value of the previous bar (based on the time I print out and the barindex being -1.
What is wrong with this??? Every single piece of example code says to use BARSTATE_NEWBAR to get the first tick of new bar but this definately doesn't work for me!!
Comment