EA Making trades way above High

 

Chart attached.

Any reason why my EA is making buy orders way above the candle high? Doesn't seem to do this with sell orders in the opposite direction.

It doesnt do this in all cases, just some of the time.

Files:
EURUSDM1.png  29 kb
 
tnil25:

Chart attached.

Any reason why my EA is making buy orders way above the candle high? Doesn't seem to do this with sell orders in the opposite direction.

It doesnt do this in all cases, just some of the time.

It is called "Spread". The chart only shows the candles OHLC values based on Bid prices, but BUY orders open at the Ask price (Ask = Bid + Spread).

The rules are as follows:

  • BUY order opens at Ask, but closes at Bid
  • SELL order opens at Bid, but close at Ask
EDIT: This is not usually very visible on a Daily on even a H1 chart, but on an M1 chart it can be very drastic if the average bar range is much smaller than the spread.
     
    Fernando Carreiro:

    It is called "Spread". The chart only shows the candles OHLC values based on Bid prices, but BUY orders open at the Ask price (Ask = Bid + Spread).

    The rules are as follows:

    • BUY order opens at Ask, but closes at Bid
    • SELL order opens at Bid, but close at Ask
    EDIT: This is not usually very visible on a Daily on even a H1 chart, but on an M1 chart it can be very drastic if the average bar range is much smaller than the spread.

      Hi Fernando, thanks for the response.

      It seems the first two hours of a new day are very volatile. My proposed solution is to limit the EA to delay trading until the first two hours of a new day have passed. Would that be an ideal fix? or is there a better solution?

       
      tnil25:

      Hi Fernando, thanks for the response.

      It seems the first two hours of a new day are very volatile. My proposed solution is to limit the EA to delay trading until the first two hours of a new day have passed. Would that be an ideal fix? or is there a better solution?

      No, not ideal solution! Just because it is volatile or not does not always have direct correlation with Spread. What you should do, is make your EA monitor the spread and have it trade only when the spread is below a certain value defined by you. In other-words, for example define a "MaxSpread" input for your EA, and only trade when the current spread, or even the current average spread of several bars is below that "MaxSpread" value.
       
      Fernando Carreiro:
      No, not ideal solution! Just because it is volatile or not does not always have direct correlation with Spread. What you should do, is make your EA monitor the spread and have it trade only when the spread is below a certain value defined by you. In other-words, for example define a "MaxSpread" input for your EA, and only trade when the current spread, or even the current average spread of several bars is below that "MaxSpread" value.

      Awesome, Ill look into that. Thanks Fernando!

      Reason: