How to work 'Open prices only'
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;
}
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.