I would like that each time there is a new bar formed,
my EA checks some instructions.
You could use a static to avoid the loop. This works with repeated calls to OnTick(). Like this:
static int barcount=-1; int count=iBars(NULL,PERIOD_D1); if(count!=barcount && barcount!=-1) OnNewBarD1(); barcount=count;
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
Hi
I would like that each time there is a new bar formed,
my EA checks some instructions.
So I wrote that:
But I keep wondering if I should not have used a loop "FOR".
I thought of something like that:
But the problem with the loop FOR, how could I make sure that each loop correspond to 1 day.
So that every instruction is only check when a new bar is formed?
Thanks for your help in advance.
Ludivine