Forum

Centre of Bar Close and Breakout Strategy - Opens early - any ideas?

Hi, I am trying to code an EA which looks to see if the last bar had a close near the centre and if it did buy or sell on a breakout of the high or low of the same bar but the opening of orders does not happen when I expect. Any ideas? Thanks very much. Code follows

Logic not working!!!

Hi, I am trying to code an EA which looks to see if the last bar had a close near the centre and if it did buy or sell on a breakout of the high or low of the same bar but the opening of orders does not happen when I expect. Any ideas? Thanks very much. Code follows