Testing Expert Advisors with Non-Standard Time Frames in MT4
Summary
This article presents a workaround for backtesting MetaTrader 4 Expert Advisors on time frames the Strategy Tester does not offer directly. It uses the period converter to build custom bars from available minute data, exports those bars to CSV, then imports them into standard history slots in an offline testing terminal. The tester is then run on the corresponding standard slot, while the Expert Advisor and its indicators request that slot as the custom interval. The process also supports testing an Expert Advisor that combines signals from two such intervals.
The article demonstrates the setup with moving-average crossover examples and recommends visually checking trades against charted averages. These examples validate that the substituted history is being read as intended; they are not evidence of strategy profitability. The procedure requires sufficient source minute history and manual export, import, and cleanup, with no automatic refresh. Care is therefore needed to keep the test data aligned with the intended custom bars and to repeat the preparation when history changes.
Key ideas
- Custom bars can be created from minute history with the period converter and exported for import into a testing terminal.
- Imported custom-interval data can replace a standard time-frame history slot for Strategy Tester use.
- An Expert Advisor can access the substituted interval by requesting the standard slot that holds its data.
- The described setup can support strategies that combine signals from two custom time frames.
- The process is manual and should be checked visually; the example does not establish profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.