Odd backtest behavior in MT4. Ask is unrealistically far away while bid is correct. (This behavior is new, but showing on old data).

 

As the title states, I've been finding odd entries and exits during backtests recently. This occurs on all EA's even the examples provided (like the "MACD Sample").

It's even occurring on old data that I've been running tests against for the past couple weeks. This has not always been the case.

My broker is Oanda.

The attached image is an example of what I'm talking about running the MACD Sample that we all have, un-edited. When plotting the Ask line (red), it's always being shown as 97 pips away on EUR/USD during normal trading hours. I can't figure out how to plot the bid, but all of the orders that hit the bid are realistic. Anything that hits the ask is 97 pips away. 

Some questions:

  • Is there some setting I should check?
  • Has anyone experienced data corruption in MT4?
  • Is there anything else I should be aware of?


EDIT:

I just had this thought, does MT4 not save bid and ask information in the database? Does it instead use current (live) bid and ask spread information during backtests? I ask this because the behavior seemed to have started at the end of Friday's trading session, and has remained so while trading has been closed.

Files:
Capture.PNG  9 kb
 

T I: I just had this thought, does MT4 not save bid and ask information in the database?

Does it instead use current (live) bid and ask spread information during backtests?

I ask this because the behavior seemed to have started at the end of Friday's trading session, and has remained so while trading has been closed.

  1. No.
  2. No. The spread is constant during the run. It is the current spread for the pair (your broker,) at the moment you start the test.

    If you start the test on the weekend, the current spread is likely to be very large.

    Always specify Tester Spread

  3. Most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134. The charts show Bid prices only. Turn on the Ask line to see how big the spread is, Tools → Options (Control-O) → charts → Show ask line.

 

Thank you @William Roeder for the reply.

Unfortunate that it doesn't record and use Bid + Ask! This system can have some misleading results, especially if your EA makes trades during the slower hours.

I suppose the best practice for MT4 EA optimization is to manually enter the average spread, erroring on the high side.

Reason: