Problem with coding this condition..

 

Hi everyone, can you help me?

I wrote an ea of "Breakout strategy", levels of breakout depend from the values of High, Low and Close of the previous bar. How to code this condition? The EA ne hasn't to open new position, but only 1 trade for every signal. Example: Breakout buy: 1,2253 breakout sell: 1,2190 if take profit 10 pips 1,2263 ea closes the position, but the condition of breakout is still valis, i want to avoid this, but maximum 1 trade for ev ery signal. Levels of breakout depend of the prevvious bar. when opens new bar will be new levels of breakout.

Regards Luca

Reason: