Seemed reasonable to include this question in this thread - hope that is ok!
Please tell me how to test for last bar.
I am trying to print a debug message when the last bar is reached.
The only bar state definitions I can find are:
BARSTATE_NEWBAR, BARSTATE_CURRENTBAR and BARSTATE_ALLBARS
whose values are 0, 1 and 2.
I tried ALLBARS but that did not work.
For example:
The following 2 lines of code print the debug message at bar number 65.
if(getCurrentBarCount() = 65) //WORKED OK
{debugPrintln("*************TOTAL ERRORS=" my_error_counter));}
The following NEVER(????) prints the debug message.
if(getBarState() == BARSTATE_ALLBARS) //DID NOT WORK
{debugPrintln("*************TOTAL ERRORS=" my_error_counter));}
Please tell me how to test for last bar.
I am trying to print a debug message when the last bar is reached.
The only bar state definitions I can find are:
BARSTATE_NEWBAR, BARSTATE_CURRENTBAR and BARSTATE_ALLBARS
whose values are 0, 1 and 2.
I tried ALLBARS but that did not work.
For example:
The following 2 lines of code print the debug message at bar number 65.
if(getCurrentBarCount() = 65) //WORKED OK
{debugPrintln("*************TOTAL ERRORS=" my_error_counter));}
The following NEVER(????) prints the debug message.
if(getBarState() == BARSTATE_ALLBARS) //DID NOT WORK
{debugPrintln("*************TOTAL ERRORS=" my_error_counter));}
Comment