Getting started with forex (MT5)
Backtest strategies on your own broker's MetaTrader 5 account and run them paper → demo → real. You set this up once. If it is your first time, follow along with your broker's demo account.
What you need
· A Windows computer or Windows VPS (it must stay on to keep strategies running) · MetaTrader 5 and an account from your broker — start with a demo account · A coinsori account
Install the agent (the EA comes with it)
On the agents screen choose Windows and paste the one-line command into PowerShell. The installer installs and pairs the agent, then copies the EA into every MT5 on this computer (folder below) and tries to compile it. If you installed MT5 later, run the same command again.
MQL5\Experts\Sori\SoriBridge.mq5Open the agents screen →
Two MT5 options
MT5 → Tools → Options → Expert Advisors: turn on "Allow WebRequest for listed URL" and add the address below. Same window, Charts tab: set "Max bars in chart" to Unlimited and restart MT5 (otherwise history is cut at 100,000 bars).
127.0.0.1
Attach the EA to ONE chart
Navigator → right-click Expert Advisors → Refresh → drag SoriBridge from the Sori folder onto any one chart (a second chart is refused). The three inputs are the last gate for orders — turned off, the EA refuses whatever the agent sends. The [Algo Trading] button at the top must also be on for orders to go out.
AllowTrading · AllowLive · MaxLotPerOrder
Using MT4 — SoriBridge4
MT4 has no sockets, so the EA talks to the agent over WebRequest (HTTP). The installer copies and compiles the EA into MT4 as well (folder below). ① Tools → Options → Expert Advisors: turn on "Allow WebRequest for listed URL" and add the address below exactly, port included. ② In the same tab turn on "Allow automated trading", and the AutoTrading toolbar button too. When it is off, MT4 does not run the EA at all — a frowning face at the top right of the chart means this. ③ Attach SoriBridge4 to one chart, press F7 and on the Common tab turn on "Allow live trading". A smiling face means it runs; the terminal shows up in the Forex tab within 30 seconds. Data only? Set AllowTrading=false on the Inputs tab (or AllowLive=false to block real accounts only) — the EA then refuses orders even with automated trading on.
http://127.0.0.1 MQL4\Experts\Sori\SoriBridge4.mq4
Check the connection
Within 30 seconds the terminal appears in the Forex section of the agents screen: broker · server · last three digits of the login · account currency · demo/real. If it does not, see "When you are stuck" below.
Open the Forex section →Put your symbols in Market Watch
Only symbols in MT5's Market Watch get a minimum order and margin figure. Use the broker's symbol names as they are (EURUSD, EURUSD.m, XAUUSD …).
Add symbols to the candle store
In the candle store's Forex tab pick the terminal → symbol and add it. The agent collects that broker's 1-minute bars on your computer and builds the other intervals from them. Once bars are in, you can backtest. The same EURUSD at two brokers is two different series (their prices differ).
Open the candle store →Deploy — paper → demo → real
In the strategy studio press deploy and choose forex; it asks for the terminal and the symbol. Under the symbol you see "min 0.01 lot ≈ … exposure · margin ≈ …" — if your per-order cap is below that, every order would be skipped, so deploy is blocked. Caps, starting cash and P&L are all in your account currency. Run paper first, confirm real orders on the demo account, then move to the real account.
Open the strategy studio →Watch it on the live trading screen
On the chart, solid lines are orders actually placed; dashed lines are prices the strategy says it is waiting for. The "~5m–20m" next to a dashed line is an estimated range from recent volatility (14-bar average range), not a time prediction. The [0.01 lot] at the end of each fill log lets you match it against MT5.
Open the live trading screen →- Market orders only — no limit orders or cancels yet. One run = one terminal (account), with as many symbols as you like. No multi-exchange bundles (legs) or clusters.
- Exchange-traded products and expiring futures are refused. Index and oil CFDs work.
- Backtest bars contain no spread and no swap — the shorter and more frequent the trades, the better the backtest looks compared with reality. Swap is your choice in the backtest settings (off by default).
- The backtest uses the same units as execution — the terminal's account currency, orders rounded down to the lot step, and orders below the minimum lot skipped. The only remaining difference is for symbols whose profit currency differs from the account currency (USDJPY on a USD account): the backtest holds the exchange rate fixed while a position is open, a small error the result notes.
- AI (connectors) cannot deploy forex — it needs a terminal choice, so you deploy from the screen yourself. The AI can still backtest and develop strategies.
- EA log says "nothing is listening" — the agent is not running (it restarts briefly during updates). The EA reconnects by itself.
- Updated the EA but nothing changed — recompiling does not change an EA already on a chart. Remove it from the chart and attach it again.
- Minimum order shows "unknown" — put that symbol in Market Watch and re-attach the latest EA.
- History is short — check that "Max bars in chart" is Unlimited and restart MT5. You cannot go further back than your broker keeps.
- The MT4 terminal does not show up · the face on the chart frowns — automated trading is off, so the EA is not running. Turn on MT4 ② and ③ above. Adding the URL without turning on automated trading ends up exactly here.
- Check the agent log (agent.log): MT4 writes "[mt4] terminal connected", MT5 "[mt5] terminal connected" ("[mt4] EA HTTP bridge listening" only means the agent is waiting). If the EA Experts tab shows an error number, send us that line as-is.
All documentation — Guide