HorizonAI App

Backtesting in HorizonAI

Run a real MT5 backtest in your browser — no MT5 install needed

HorizonAI ships with a built-in MT5 backtester. Whatever MQL5 strategy the AI writes for you can be tested against a year (or more) of real market data with one click — right inside the chat. Your code runs on a real MetaTrader 5 terminal in the cloud, and the AI can read the results and suggest improvements.

This guide covers the in-app backtester in HorizonAI. If you want to run optimizations on your own machine using MT5's built-in Strategy Tester instead, see Backtesting in the MetaTrader 5 Desktop App.

What it is

HorizonAI's backtester runs your MQL5 Expert Advisor on a real MT5 terminal in the cloud and returns the same metrics MetaTrader's Strategy Tester would — net profit, profit factor, Sharpe, max drawdown, win rate, an equity curve, and a trade-by-trade breakdown — directly in the chat panel.

Because it's running real MQL5 (not an emulation), anything the AI writes for MT5 — moving averages, RSI, MACD, Bollinger Bands, Ichimoku, custom logic — works as it would in MetaTrader.

1) Open a chat and build (or paste) a strategy

  1. Go to app.horizontrading.ai and open or create a new chat.
  2. Make sure the script type is set to MT5 (MQL5) — Pine Script strategies aren't supported by the backtester.
  3. Describe the strategy you want, e.g. "EMA 20/50 crossover EA with a 2× ATR stop and 3× ATR take profit." The AI writes the EA and shows it in the Code panel on the right.

The backtester only runs Expert Advisors (strategies that place trades) — indicators alone can't be backtested. If your code has #property indicator, ask the AI to convert it to an EA.

2) Open the Backtest tab

In the right-side panel, switch from Code to the Backtest tab. You'll see:

  • A Symbol dropdown
  • A Timeframe dropdown
  • A Run button
  • (Pro/Elite) From and To date inputs for a custom window

If your EA defines input parameters (lot size, periods, stop multiples, etc.), an Inputs button lets you edit them before running.

3) Pick a symbol and timeframe

Supported symbols (30 total):

  • Forex majors — EURUSD, GBPUSD, USDJPY, USDCHF, USDCAD, AUDUSD, NZDUSD
  • EUR / GBP / AUD / CAD / NZD / CHF crosses — EURGBP, EURJPY, EURCHF, EURCAD, EURAUD, EURNZD, GBPJPY, GBPCHF, GBPCAD, GBPAUD, GBPNZD, AUDJPY, AUDCHF, AUDCAD, AUDNZD, CADJPY, CADCHF, NZDJPY, NZDCHF, NZDCAD, CHFJPY
  • Metals — XAUUSD (Gold), XAGUSD (Silver)

The dropdown is searchable — start typing a pair to filter.

Supported timeframes: M1, M5, M15, M30, H1, H4, D1, W1.

Free trial accounts can backtest on H4, D1, and W1 only. Lower timeframes (M1–H1) and custom date ranges are part of the Pro plan.

4) Click Run

Hit Run. A typical backtest finishes in about 30 seconds — but if the global queue is busy you'll see your position in line. You can keep chatting with the AI while it runs.

By default, the backtest covers the last 12 months. Pro accounts can pick any 2-year window; Elite goes back up to 10 years.

Let the AI run it for you. If you say something like "backtest this" in the chat, the AI will pick a sensible symbol, timeframe, and window, kick off the run itself, and then read the result back to suggest improvements.

5) Read the results

When the run finishes, the panel shows three views:

  • Report — a clean Strategy Tester report: net profit, gross profit/loss, profit factor, expected payoff, Sharpe ratio, recovery factor, balance and equity drawdown (dollar and %), total/winning/losing trades, long vs short breakdown, max consecutive wins/losses.
  • Trades — a sortable table of every trade: entry time, exit time, direction, entry/exit price, duration, P&L.
  • Chart — the price candles with green entry markers and red exit markers, plus the equity curve below.

Above the panel you'll also see a row of pills showing your previous backtests in this chat — click any one to bring its results back up.

6) Improve the strategy with the AI

This is where the in-app backtester earns its keep. Once a result is in front of you, just ask the AI things like:

  • "Why is the win rate so low on shorts?"
  • "Try a tighter stop — what changes?"
  • "Add a session filter so it only trades London hours."

The AI can read the metrics, the trade list, and your EA code together. It will edit the EA and offer to run a new backtest.

Limits, defaults & fine print

  • Initial deposit: $10,000 (fixed)
  • Commission: 0.1% per trade
  • Slippage: not modeled
  • Fill model: orders fill at the close price of the bar
  • Modeling: 1-minute OHLC (real MT5 data, downloaded from MetaQuotes-Demo)
  • One run at a time per user — wait for your current backtest to finish before queuing another.
  • Free trial: 5 backtests total, H4/D1/W1 only, fixed 12-month window.
  • Pro: unlimited backtests, all timeframes, custom date ranges up to 2 years back.
  • Elite: same as Pro, custom ranges up to 10 years back.
  • Timeout: runs that don't finish within 15 minutes are marked failed.

Past performance does not guarantee future results. The backtester assumes instant fills at the close price and does not model spreads, slippage, market impact, or liquidity. Treat the report as a sanity check on your logic — not a forecast.

When to use this vs. the MT5 Desktop Strategy Tester

Use HorizonAI's in-app backtester when…Use the MT5 Desktop Strategy Tester when…
You want a quick read on whether the AI's strategy is even worth keepingYou want to optimize input parameters (genetic / brute-force sweeps)
You don't have MT5 installed or are on a Mac/Linux machineYou want walk-forward or multi-pass analysis
You want the AI to read the result and iterate with youYou want to backtest with your broker's actual tick data and spread
You're testing forex or metalsYou're testing instruments outside the supported forex / metals list

Many users do both: iterate fast in HorizonAI to find a strategy that holds up, then move the EA to the MT5 desktop platform for deeper optimization. See Backtesting in the MetaTrader 5 Desktop App for that workflow.

Troubleshooting

  • "Indicators can't be backtested" — your code has #property indicator. Ask the AI: "convert this indicator into an EA that trades on its signal."
  • "No trades" — your entry conditions never triggered in the test window. Widen the date range (Pro/Elite), pick a more volatile symbol (XAUUSD is a good stress test), or loosen the conditions.
  • Stuck in the queue — the worker runs one backtest at a time globally. Most queues clear in under a minute.
  • Timeframe locked with "(Pro)" — you're on the free trial. Upgrade to Pro to unlock M1–H1.
  • First run on a symbol feels slow — the first time a symbol is touched, MT5 downloads its history. Subsequent runs on the same pair are faster.

Understanding Your Results

Related Guides