Hello, I would need help to modify a function called "isDelayed()" that makes an EA to open orders at the next candle. The problem is that it opens multiple orders sometimes and also is for next candle and not current, I need a function to open only one single order at open of the current candle and not at the next candle, given the conditions of BUY order in the line:
The isDelayed() function is this:
Could any coder please modify it or make a different function in order to open one single order at the open of the candle when the condition "iOpen(NULL,0,0)>MA" is given?
Thank you.
Regards
Inserted Code
if(OpenBUY && iOpen(NULL,0,0)>MA && isDelayed())
The isDelayed() function is this:
Inserted Code
bool isDelayed(){ if(wait_next_candle_to_open==false) return(true); datetime last_one=getLastClosedTrade(); int index=iBarShift(Symbol(),0,last_one); if(index>0) return(true); return(false); }
Could any coder please modify it or make a different function in order to open one single order at the open of the candle when the condition "iOpen(NULL,0,0)>MA" is given?
Thank you.
Regards