TAYU Academy course material · MQL5 EA Programming Intro
Text walkthrough
Using the Strategy Tester
A self-paced text walkthrough, without video or audio. See the article below for worked examples and materials.
Course Notes
1. Understand the core idea of “Using the Strategy Tester” and explain it in your own words
2. Master this module's focus: Backtesting and optimisation
3. Complete the assignment on your own and check it against the reference answer
Testing results depend on modeling mode, spread, data, and contract specifications. A backtesting EA without a trading performance curve is a normal situation and cannot be compiled into a strategy's execution performance.
In the MT5 Strategy Tester, select the "Based on Real Tick Spreads" mode and set the actual spread and commission. Be mindful of overfitting during optimization and use walk-forward testing, retaining the out-of-sample interval. Passing the backtest does not equate to effectiveness in live trading.
Optimize for the period of the moving average 10–50, and validate within the "walk-forward test 1/4" interval; if the forward test result shows a significant decline, then abandon this set of parameters.
Select a fixed instrument/interval/model → write version parameters → check log frequency → verify missing bars/errors → save terminal report, distinguishing static reading from actual execution.
The companion read-only EA shows zero trades in the tester. Is that an execution failure or as designed? What else should be checked?
Zero transactions comply with no-order placement design; initialization, bar processing, and signal logs must also be verified. It cannot be claimed that automatic orders or profitability tests have passed based on this, as gaps remain if the terminal is not running.
The parameters trained on the 10/30 dataset showed good results, but the out-of-sample difference was noticeable. After slightly modifying the parameters on the 11/31 dataset, the results changed significantly, indicating instability. Only record signals; examples should report the number of signals, the time, and repeat checks. Verification of gains should use an offline script for the course, separate from the MT5 real strategy backtest.
Optimisation must not select on final test returns; signal counts must not be swapped for fill counts.
The companion .mq5 file only logs signals and never submits orders. Below is a terminal checklist; having the source on the web does not mean it has compiled or run in your terminal. Without a terminal, complete the state machine on paper and record which steps were not run.
1. Download AcademySmaSignal.mq5
2. Open and compile it in MT5 MetaEditor; save the version and diagnostics
3. Watch new-bar signal logs on a demo chart or in the Strategy Tester only
4. Check CopyBuffer failures, duplicate new-bar events and resource release on exit
5. Do not enable live trading; verify the order state machine on paper1. Use real-tick mode
2. Run a walk-forward test
3. Passing a backtest does not mean it works live
Risk warning: leveraged trading in forex, precious metals and similar products carries a high level of risk and you may lose all of your capital, or more. This course is for education only. It is not investment advice and does not promise any return. Example prices and contract specifications are teaching assumptions; always use what your own platform discloses. Past performance and backtests do not indicate future results.
All values, prices, accounts and cases in this course are teaching assumptions; the fixed materials can be reproduced offline. Marking a lesson complete only records your study. It is not a certification, a service approval or a promise of returns. Workbooks and answer files are currently provided in Chinese.
Key Takeaways
Completion records your own study, not verified competence. Exercises use fictional data; no real account or deposit is required.