Page 1 of 1

Time Period selection

Posted: Fri May 09, 2025 12:43 pm
by TrendCatcher
I reference H4 and D1 equally in my Expert advisor. I download both timeframes form tickstory. So when I run my backtest in MT4 (Not visual mode), which period must I select H4 or D1 inside of MT4? They give different results, just need to know which one to believe.

Re: Time Period selection

Posted: Sat May 10, 2025 5:05 am
by tickstory
Hi Trendcatcher,

It depends on how you've coded your EA. In the MQL language, you can explicitly refer to the timeframe you would like to reference (eg. iMA("EURUSD", PERIOD_H1,...). If you are putting NULL in the timeframe parameter, then it means you are using the default time-frame that has been selected on the Tester/Chart. Presumably this is the reason for the different results so you'll need to check your code accordingly.

Hope this helps.

Re: Time Period selection

Posted: Wed May 14, 2025 11:19 am
by TrendCatcher
Thanks

I do not use NULL ever. I do reference the timeframes with PERIOD_H4 and PERIOD_D1.

Re: Time Period selection

Posted: Wed May 14, 2025 1:17 pm
by tickstory
Hi Trendcatcher,

The best way forward is to compare the first trade in each of your back-tests to understand why there's a difference between the two periods. Visual mode and some debugging info is likely to be useful.

Hope this helps.