EA opens positions at prices NOT within bars

 

I have noticed this a few times. Some of the EA's I have been working up open positions at prices that are not within a candle.

I have checked my History data and it is the same as that shown in the bars. Also, the output of indicators (eg. Stochastic) is correct, so the indicators are using the "correct" values of price.

Has anyone seen this? Any suggestions as to how to deal with it?

I have attached a picture showing what the problems is.

 
Check the Tester log see if that gives you any more clues . .
 

It's called SPREAD


//z

 
RaptorUK:
Check the Tester log see if that gives you any more clues . .

Thanks for the thought - that was my first reaction and I added several print statements to check in detail - the perplexing thing is that those results are all correct.
 
I think zzuegg is probably correct, what is your spread ?
 

Your image shows you bought 2 pips above the high. Mql4 charts are bid chart. For buy you open at the Ask == Bid + spread. So the open shows above the candle.

On a Sell, your stops are at the Ask. You would see the order closed by stop loss even though the candle never reached that high.

Turn on the ask line in the options, it will give you a sense of how big the spread is relative to the variable chart scale.

Reason: