Export to MetaTrader 5 (MQL5)
Export a Backtrex strategy as an MQL5 Expert Advisor for MetaTrader 5: generation, compiling in MetaEditor and testing in the Strategy Tester.
Overview
Backtrex can write your backtested strategy as an MQL5 Expert Advisor, to compile in MetaEditor and test in MetaTrader 5.
Before you export
- Only a backtested version exports. Run your draft's backtest first.
- Exporting counts toward your usage gauge, unless the same export was already written for this backtest.
- The script is generated, to validate in your platform. Backtrex does not promise a set divergence figure against the MetaTrader tester: your broker's price feed and conditions differ.
How to export
- Pick the backtest in the backtest menu
- Click Export
- Choose MetaTrader 5, MQL5
- Click Generate: the AI writes the code, then checks the Expert Advisor
- Click Copy or Download
Install in MetaTrader 5
- Open MetaEditor from MetaTrader 5
- Create a new Expert Advisor and replace its content with the exported code (or put the downloaded file in the
MQL5/Expertsfolder) - Compile
- In MetaTrader 5, open the Strategy Tester and pick the Expert Advisor
Check the Expert Advisor
On the same asset and period as your Backtrex backtest:
- compare the number of trades and a few entries and exits
- check the tester's spread and commission
- pick a precise modelling mode (real ticks if your broker provides them)
Always test on a demo account before any live use.
Tips
- If the difference comes from a rule, fix it in Backtrex, run the backtest again and export again
- For a trade-by-trade check, use the Python export