HI David,
I think by working"Open prices only" you want to execute the code only once per bar, you can use the following function to achieve the purpose.
static datetime bar_time=0;
bool New_Bar()
{
if(bar_time!=iTime(_Symbol,0,0))
{
bar_time=iTime(_Symbol,0,0);
return true;
}
return false;
}

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
Hello traders, I tried using this but it doesn't catch all the trades:
I wonder if there is any other method for working 'Open prices only', cause optimization would be much more faster.