Download MetaTrader 5

Multiple timeframes and backtesting. Workaround

To add comments, please log in or register
kenned45900
73
kenned45900  

I have an EA  for Period 5 min but in the code I also use daily data like the daily 8 and 21 SMA.  I want to backtest my EA but since  MT4 cannot backtest multitimeframe  I need a workaround for this:

I have this daily SMA filter:

iMA(Symbol(),PERIOD_D1,8,0,MODE_SMA,PRICE_CLOSE,0)  <  iMA(Symbol(),PERIOD_D1,21,0,MODE_SMA,PRICE_CLOSE,0)

I need to rewrite so the daily 8 and 21 SMA is  calculated from the 5 min chart. I've tried to put in 2304 and 6048 instead of but it dosen't seem to work:

iMA(Symbol(),0,2304,0,MODE_SMA,PRICE_CLOSE,0)  <  iMA(Symbol(),0,6048,0,MODE_SMA,PRICE_CLOSE,0

 

I also use this formula and need to rewrite so it works with 5 min backtest:

iHigh(Symbol(),PERIOD_D1,0)-iLow(Symbol(),PERIOD_D1,0)

 

Same with this,  find daily ATR:

iATR(Symbol(),PERIOD_D1,10,0)

I would really appreciate if somebody can help or give me som hints.

Simon Gniadkowski
Moderator
18025
Simon Gniadkowski  
kenned45900:

I have an EA  for Period 5 min but in the code I also use daily data like the daily 8 and 21 SMA.  I want to backtest my EA but since  MT4 cannot backtest multitimeframe  I need a workaround for this:


Yes it can.
kenned45900
73
kenned45900  
RaptorUK:
Yes it can.


hmm interesting. I'm new to programming but I just started using Molanis and on their website they write: 

"Multi timeframe EAs CANNOT be backtested in MT4. It is not possible. This ea will work fine but backtesting results are misleading. MT4 can backtest one timeframe at a time. The only way to backtest multi timeframe EAs is using MetaTrader 5"  http://www.molanis.com/products/molanis-strategy-builder/expert-advisors-for-mt4

Why would they write this if its wrong?

I guess you know what youre talking about, but what is the trick to make it work? Do I need 99% modeling quality?  I use 90

Simon Gniadkowski
Moderator
18025
Simon Gniadkowski  
kenned45900:

hmm interesting. I'm new to programming but I just started using Molanis and on their website they write: 

"Multi timeframe EAs CANNOT be backtested in MT4. It is not possible. This ea will work fine but backtesting results are misleading. MT4 can backtest one timeframe at a time. The only way to backtest multi timeframe EAs is using MetaTrader 5"  http://www.molanis.com/products/molanis-strategy-builder/expert-advisors-for-mt4

1.  Why would they write this if its wrong?

I guess you know what youre talking about, but what is the trick to make it work? Do I need 99% modeling quality?  I use 90

1.  you will have to ask them:  first read this:  Testing Features and Limits in MetaTrader 4

You only get 99% modelling quality using tick data and a 3rd party paid for application,  and then 99 is just the number written to a file,  it doesn't mean anything.

Simon Gniadkowski
Moderator
18025
Simon Gniadkowski  

Perhaps they are talking about this:

 

"Zero bar of another timeframe for the same symbol under test is modeled approximately

Open = correct Open, Close = correct Close, Low = min (Open,Close), High = max (Open,Close), Volume = final Volume (false)"

 

it may be a problem if you use Indicators that re-paint . . .  which you seem to be doing in your post above.

kenned45900
73
kenned45900  
RaptorUK:

1.  you will have to ask them:  first read this:  Testing Features and Limits in MetaTrader 4

You only get 99% modelling quality using tick data and a 3rd party paid for application,  and then 99 is just the number written to a file,  it doesn't mean anything.


Thank you very much. I've done som simple testing now and it works.
whroeder1
15913
whroeder1  
RaptorUK: 1.  you will have to ask them:  first read this:  Testing Features and Limits in MetaTrader 4
It also states "Zero bar of another timeframe for the same symbol under test is modeled approximately" which is no longer true.
Alain Verleyen
Moderator
33295
Alain Verleyen  
Comments that do not relate to this topic, have been moved to "MTF Stochastic Indicator and Strategy Tester".
To add comments, please log in or register