CP + MT5 Backtest magic

Avatar
  • updated
  • Answered

Hi, I would like to improve the reliability of backtests using OHCL. (spread data in MT5 is very unreliable - check GBPUSD dec 2014. Testing with tick data introduces actually more overfitting risk than reliability... :(   )

In order to do that, it is important to understand the tricks MT uses to place the orders when OHCL is used.

It is right now, it is more than confusing!


Lets take this set file:gbpusd_1m_baaad.set

It basically buys immediately when the prices goes under MA(1h, 10) and closes when the price goes above MA(1h, 10).

This is a configuration which was found by the optimizer working supervery awesome well. 


It basically enters when the price moves 1 point below MA (MA Filter).

Image 3743

So the EA BUYs (only) if the prices goes below the MA(1h, 10) line.

Image 3755

Now, just for overview, the results for OHCL and tick data are

OHCL:

Image 3746

Tick data:

Image 3747

When we take a closer look at the positions, we see

OHCL:

Image 3744

Ticker:

Image 3745

How there are the resulting core questions:


* Since CP opens a position when the price is BELOW the MA(1h, 10) line,  why is always the LOW price of 1min candle hit inside the OHCL backtest?

* Why is always the HIGH price of a candle hit inside the backtest when the position is closed?



Avatar
0
Andrey Khatimlianskyi

Not always. And the low price will be under the MA much frequent than the high price. Isn't logically?)

Real ticks mode doesn't lead to overfitting.

And you have to understand OHLC mode very well to safely use it.

Avatar
0
Hannes Waser
Quote from Andrey Khatimlianskyi

Not always. And the low price will be under the MA much frequent than the high price. Isn't logically?)

Real ticks mode doesn't lead to overfitting.

And you have to understand OHLC mode very well to safely use it.

Thank you.

As far as I understand, the indicator uses  close price to compute MA.

The decision if a new trade should be opened happens oneach new candle. At this time we receive the information that the new open[t] is above SMA.

So the price should be close[t-1] or open[t].

Not low[t] or low[t-1].

right?

What do I miss here?

Avatar
0
Andrey Khatimlianskyi
  • Answered
Quote from Hannes Waser

Thank you.

As far as I understand, the indicator uses  close price to compute MA.

The decision if a new trade should be opened happens oneach new candle. At this time we receive the information that the new open[t] is above SMA.

So the price should be close[t-1] or open[t].

Not low[t] or low[t-1].

right?

What do I miss here?

Nope, you're wrong. We don't have "Use closed bars only" option for the MA below/above filter.