Control points do not exist, they don't correspond to real prices or real events. They are simulated.
Your method is basically ok, I do the same, but I would consider using Time[0] instead of Bars. I usually have something like this in my EAs:
void onTick(){ } void onOpen(){ } int start(){ static int last_time; onTick(); if (Time[0] == last_time){ return(0); } last_time = Time[0]; onOpen(); return(0); }
mfurlend:
I know that it is quite possible (and often beneficial) to emulate the "Open Bars" testing mode. All you need is something like this:
if (Bars = lastBar) return(0); lastBar = Bars;
Won't work once Bars = max bars in chart.
static datetime Time0; bool New_Bar = Time0 < Time[0]; Time0 = Time[0]; if (New_Bar){...
Wow, I can't believe I didn't realize that! Thanks for the info.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I know that it is quite possible (and often beneficial) to emulate the "Open Bars" testing mode. All you need is something like this:
How about control points?