Use the following style:
datetime timeprev=0;
int start()
{
// your code on every tick like trailingstops etc can go here
if(timeprev==Time[0])
return(0);
timeprev=Time[0];
/// your code on new bar goes here
}
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
How do you run an EA only on a new bar? I've been running below but after reading the documentation, it obviously won't work.
if (Volume[0]) { return; } // since EA has already acted on this bar.