Time Period selection
-
- Posts: 5
- Joined: Thu Oct 24, 2024 12:19 pm
Time Period selection
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
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.
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.
-
- Posts: 5
- Joined: Thu Oct 24, 2024 12:19 pm
Re: Time Period selection
Thanks
I do not use NULL ever. I do reference the timeframes with PERIOD_H4 and PERIOD_D1.
I do not use NULL ever. I do reference the timeframes with PERIOD_H4 and PERIOD_D1.
Re: Time Period selection
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.
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.