QuantForge
en

How to build a forex trading robot without coding

Turn trading rules into a MetaTrader 4 or 5 trading robot (Expert Advisor) with visual blocks: entry, filters, risk sizing and exits, then backtest it on your own data and export it. No MQL needed.

Start freeRead the docsFree plan, no card needed.

Updated

A forex trading robot is a set of rules a computer follows without hesitation: when to enter, when to stay out, how much to risk and when to exit. In MetaTrader 4 and 5 it is an Expert Advisor (EA). Writing one normally means learning MQL; this guide builds one from visual blocks instead, tests it, and exports a real EA.

1. Write the rules down first

A robot can only do what you can state precisely. Before you open any tool, write each rule so that two people would read it the same way:

  • Market and timeframe: for example EURUSD on M15.
  • Trend filter: trade long only when the H1 close is above the 200 EMA, short only below it.
  • Entry: RSI(14) crosses back above 35 (long) or below 65 (short).
  • Filters: only between 08:00 and 18:00 server time, only when the spread is below 2 pips, one position at a time.
  • Risk: 1% of equity per trade, stop 15 pips, target 15 pips; stop for the day after a 3% loss.
  • Management: move the stop to break-even at +10 pips.

Vague words such as “strong trend” or “near support” have to become numbers. If you’re unsure, the AI assistant on Studio can turn a description into blocks and lists how it made each point precise.

2. Build the robot from blocks

Create a project, choose MT4 or MT5, and on the onTick canvas chain the blocks in the order a trader would check them:

  1. Daily Drawdown Guard (3%): stops trading for the day after the loss limit.
  2. Time / Session Filter (08:00–18:00) and Max Spread Filter.
  3. Once Per Bar, so the rules are checked once per M15 bar, not on every tick.
  4. Check Open Trades Count (none open).
  5. Condition (If A vs B): H1 close > EMA(200), with the timeframe set to H1.
  6. Crossover (Above/Below): RSI(14) crosses above 35.
  7. Buy Now (Market Order) with risk % sizing, stop and target in pips.
  8. Mirror steps 5–7 for the short side with Sell Now (Market Order).
  9. Move to BreakEven on its own, so it manages any open trade.

Every check has a YES and a NO output, and the canvas shows what each block does in plain words. Put the numbers you may want to change (EMA period, RSI levels, stop, risk) into Inputs, so they appear in MetaTrader’s input window and can be optimised. There are 70+ indicator values to choose from, from moving averages and RSI to Ichimoku, pivot points and Fibonacci levels (full list).

3. Backtest it on your own data

To learn the tester, start on the Practice data (simulated) every account has: it shows what the robot does, but its prices are simulated, so its profit means nothing. For results you can judge, export M1 history from your MetaTrader terminal and import it (how), so the test uses your broker’s prices. Set your real spread, commission and some slippage, then press play: the chart replays every trade while the blocks that passed light up on the canvas. Then read the report:

  • Profit factor and maximum drawdown, not the win rate. A 90% win rate with rare large losses is usually worse than 45% with winners twice the size of the losers.
  • Monthly returns: is the profit spread over the period or made in one lucky month?
  • Number of trades: fewer than about 100 says little.

4. Check it isn’t over-fitted

The best settings on past data are rarely the best settings to trade. Keep the last part of your history out of the optimisation and check the settings on it, prefer settings whose neighbours also work, and run a Monte Carlo analysis on the trades (guide).

5. Export and run it on a demo

Export the .mq5 or .mq4 source (free), or download the compiled .ex5/.ex4 on Pro. Copy it to the terminal’s MQL5/Experts (or MQL4/Experts) folder, attach it to a chart, enable Algo Trading, and run it on a demo account for a few weeks. Compare its trades with the backtest before risking real money.

Prefer to start from something tested? The template gallery has EAs kept only after staying profitable on both halves of their test history (EURUSD M1, or XAUUSD M1 for gold), which you can open, change and retest.

Frequently asked questions

What is a forex trading robot?

In MetaTrader a trading robot is called an Expert Advisor (EA): a program that runs in the terminal, reads prices and indicators on every tick and opens, manages and closes trades by its rules. It runs in your own MetaTrader terminal with your own broker.

Do I need to learn MQL4 or MQL5?

No. In QuantForge you connect blocks on a canvas and the code is generated for you. The export is readable .mq4/.mq5 source that compiles in MetaEditor with 0 errors, so you can still read or edit the code later if you want to.

Is a trading robot free to build?

The Free plan lets you build, backtest on H1 to D1 over a year, and export MQL4/MQL5 source. Paid plans add M1 backtests over full history, one-click .ex4/.ex5 builds, optimisation and the AI assistant. See pricing.

Will the robot make money?

Nobody can promise that. A robot only automates your rules: if the rules have no edge after spread and commission, automation just loses faster. Backtest on your own data, keep a forward period aside, and run it on a demo account before real money.

Build your first EA today

The free plan includes three projects, backtests on H1 to D1 over a year, MQL4/MQL5 export and the converter.

Start free

Keep exploring