Blog

How to build a MetaTrader Expert Advisor without writing MQL

TradeSmithy Team4 min read

Most traders who want an Expert Advisor never write one. The gap is not the strategy — you can describe that in a sentence — it is the several hundred lines of MQL between the sentence and something MetaTrader will run.

TradeSmithy closes that gap by making the strategy itself the artifact you edit. You assemble it as a graph on a canvas, and the graph is what gets translated into MQL4 or MQL5 source. There is no hidden template you are filling in.

The graph is the program

A strategy is built from nodes in seven categories:

CategoryWhat it does
EventsWhen the strategy runs — every tick, or the open of a new candle
IndicatorsThe 38 built-in MetaTrader indicators, plus your own compiled ones
Price dataOpen, high, low, close, and the instrument's own properties
Logic and conditionsComparisons, AND/OR/NOT, if-conditions
Trading operationsBuy, sell, close, modify
Variables and parametersValues you keep between ticks, and inputs you expose to the terminal
MathArithmetic on any of the above

The connections between them are not decoration. An edge from an RSI node's main output to a comparison node's left input is the statement if (rsi > 70). When you wire a comparison's true output into a Buy node, that is the call to open a position. Delete the wire and the call disappears from the generated code.

This is why the canvas can tell you a strategy is broken before you spend anything on generating it. An assignment with nothing connected to the variable it writes to, an indicator that the platform you are targeting does not ship, a parameter name that is not a legal identifier — each of those is caught by looking at the graph, and each names the node responsible.

Start from a template, not a blank page

There are 20 templates covering trend, oscillator, breakout, volatility, scalping and portfolio approaches. Open one and you get an editable graph, not a locked preset — every node, value and wire is yours to change.

Starting from a template is also the faster route to a good result with the AI assistant. A working graph shows the model what you are building; a blank grid gives it nothing to reason about. "Add a trailing stop of 30 pips to this" against a real strategy is a far more answerable request than "build me a scalper".

The assistant edits the graph, not a chat log

The AI assistant in the builder is not a code generator bolted on the side. It receives your current graph, returns a modified one, and the result is normalized, validated and synchronized before it is allowed to touch your canvas. Anything it produces that does not typecheck against the schema — a connection to a port that does not exist, an indicator parameter with an illegal value — is rejected rather than quietly applied.

The practical consequence: the assistant can only do things you could also have done by hand in the properties panel. That is a deliberate constraint. It means there is no category of strategy that exists only in the chat history and cannot be inspected, edited or exported.

Export is real source code

Pressing export gives you a .mq4 or .mq5 file. Open it in MetaEditor, compile it, attach it to a chart. There is no runtime library to install, no account to keep active for the EA to work, and nothing phoning home. The generated file is a normal Expert Advisor.

Which language you get is decided by the project's platform — and MQL4 and MQL5 are genuinely different languages, not dialects. We wrote about what actually changes when you switch.

What this does not do

Worth stating plainly, because the category is full of claims that are not kept:

  • It does not tell you whether a strategy is any good. It builds what you describe, and it will build a bad strategy just as faithfully as a good one.
  • A backtest is not a forecast. Historical backtesting is live — you queue a run and it comes back with an equity curve, the trade list and the log — but a result describes one strategy on one symbol, one broker's data and one date range. It is evidence, not a projection of your account.
  • Parameter optimization is still in development.
  • No performance figures, win rates or returns are claimed anywhere on this site, because we have none that would mean anything about your account.

Everything above the line — build, backtest, export, and the marketplace — works today.

Getting started

The Free plan gives you 3 projects and one MQL export, which is enough to carry an idea through to a compiled EA and decide whether the approach fits how you work. Pro at $19 and Premium at $49 per 30 days raise the project cap and the AI quotas, and unlock publishing to the marketplace.

Keep reading

← More from the TradeSmithy blog