Exporting and compiling
Source code
The .mq4 and .mq5 buttons at the top of the editor download the generated source. It’s plain, commented MQL that you can read and edit. The Code tab in the right panel shows the same file live.
Building .ex4 / .ex5
Click .ex4 or .ex5 at the top of the editor (or Export → Build). QuantForge compiles the EA with MetaQuotes’ MetaEditor on its own server and downloads the ready-to-run file a few seconds later. Nothing to install. This is a Pro feature.
If MetaEditor ever reports an error, QuantForge shows the error lines. Generated code should always compile, so please send them to support.
You can still open the downloaded source in MetaEditor and press Compile (F7) yourself.
Converting between MQL4 and MQL5
Converter in the app’s top bar turns an Expert Advisor or script written for one MetaTrader into code for the other:
- Source code (.mq4 ↔ .mq5): drop or paste the file and press Convert. Your code keeps its own functions; the converter adds the other platform’s versions of the functions it calls (orders, indicators, account and chart functions) and rewrites only what can’t be expressed that way, such as
Bid,Close[1]andexterninputs. Notes list anything to check, with line numbers. Converting is free and runs in your browser; on Pro you can build the result into an .ex4 / .ex5 straight away. - Compiled files (.ex4 ↔ .ex5): a compiled file holds no source code, and taking one apart is against MetaTrader’s terms, so only files QuantForge built for your account can be converted. Drop one and QuantForge recognises it by its fingerprint (the file stays in your browser), then rebuilds it for the other platform from the strategy or source it was made from (Pro). For any other EA, convert its .mq4 / .mq5 source.
Indicators and EAs built on MQL5’s Expert framework (CExpert) aren’t converted yet. Always run a converted EA in the Strategy Tester before trading with it. In the editor, the converter is also under Project → Converter.
Installing the EA
- In MetaTrader, File → Open Data Folder, then
MQL5\Experts(orMQL4\Experts). - Put the
.ex5/.ex4(or the source, then compile it) there. - Refresh the Navigator, drag the EA onto a chart, review the inputs, and allow algorithmic trading.
Test on a demo account first.