A multi-symbol trend-following bot for MetaTrader 5. It watches EURUSD and GBPUSD on the hourly chart, takes trades only when several filters agree, and manages every position with a trailing stop and hard drawdown limits.
This is educational software. Forex trading carries a significant risk of loss, and backtested performance does not predict future results. The bot ships in paper mode and refuses to attach to a real-money account until you explicitly change that. Leave it in paper mode and forward-test on a demo account for a meaningful stretch of live market conditions before you even consider real capital. Nothing here is financial advice.
Three things, and the second one catches people out most often.
| Windows | Any recent Windows that runs MetaTrader 5. A Windows VPS is the usual choice if you want the bot running around the clock. |
|---|---|
| MetaTrader 5 | The actual MT5 terminal, installed and logged into an account. The bot is a client that drives your terminal — it is not a broker connection of its own and cannot trade without one. Get it from your broker (preferred, since their build knows their servers) or from metatrader5.com. |
| An account | A demo account to start with. You need the login number, password and server name your broker gave you. |
The released mt5bot.exe is a 64-bit Intel build and runs under
emulation on ARM64 Windows. You only need to care about architecture if you build
from source — see Building from source.
The release is a single executable. There is nothing to install and no folder to keep alongside it.
Get the latest mt5bot-*-windows.zip from the releases page and
extract it somewhere permanent — the bot runs from wherever you put it.
Each release ships a matching SHA256 file. Compare it against the archive:
certutil -hashfile mt5bot-<version>-windows.zip SHA256
The value should match the one in the release's .sha256.txt.
Double-click mt5bot.exe. The manager window opens — this is where
everything is configured. Windows may warn that the publisher is unknown,
because the executable is not code-signed; that is expected for this build.
Everything below is set inside the manager. Your settings are stored in the Windows app data folder, so they survive restarts and upgrades.
Fill in your login, password and
server exactly as your broker supplied them. Leave the
terminal path blank unless you have several MT5 terminals installed — blank
means auto-detect, which is what you want. If you do need it, the file to
point at is terminal64.exe.
The default is EURUSD,GBPUSD. These are the two the strategy was
validated on. USDJPY was deliberately dropped after testing showed it
underperformed structurally.
Telegram needs a bot token and chat ID; email needs an SMTP user, password and recipient. Both are optional, and the bot trades identically without them — you simply will not hear about it until you check the journal.
The Startup Health panel verifies MT5, your symbols, Telegram and SMTP, and shows each as green or red. Get everything green before you start trading. If email alerts are on, this also performs a real SMTP login, so a wrong password fails here rather than silently at the first alert.
Press Start. The Activity Console streams what the bot is doing; the verbose toggle adds detailed per-loop diagnostics when you want to see the reasoning behind a decision.
This is the single most important setting in the application.
| Paper (default) |
A forward test. The bot runs the full strategy against live market data and
records every trade it would have taken to
journal/paper-trades.csv. It will refuse to start
if the account it is pointed at is a real-money one, so paper mode cannot
quietly become live trading by accident.
|
|---|---|
| Live | Real orders, real money. You must set this deliberately. Anything unset or unrecognised means paper — the safe direction. |
A backtest tells you how a strategy behaved on data it has already seen. Paper mode tells you how it behaves on data nobody has seen yet, including how your broker's spreads and execution treat it. Those are different questions, and only the second one predicts anything.
A trend-following strategy on the hourly chart. Several conditions must agree before it enters, which means it trades infrequently by design.
| Entry trigger | EMA(20) crosses EMA(100) |
|---|---|
| Trend filter | Price must be on the correct side of EMA(200) |
| Momentum filter | RSI(14) between 45–75 for longs, 25–55 for shorts |
| Volatility floor | ATR(14) at least 0.04% of price, which filters out dead and choppy markets |
| Session filter | Only the high-liquidity London/New York overlap, 07:00–20:00 GMT |
| News blackout | No entries within ±30 minutes of a high-impact release, read from the MT5 economic calendar |
| Stop loss | 2.5 × ATR, so it adapts to current volatility rather than a fixed pip distance |
| Take profit | None. Exits are managed entirely by the trailing stop, which is what lets a strong trend run |
| Trade management | Stop moves to break-even at +2.0 × ATR; trailing stop activates at 3.5 × ATR |
If it seems to be doing nothing for long stretches, that is usually correct behaviour — most hours fail at least one of these filters.
These run whether or not you are paying attention, and they are the reason the bot stops itself rather than trading through a bad run.
| Per trade | 1% of account equity, sized from the stop distance rather than a fixed lot |
|---|---|
| Leverage cap | Hard ceiling of 25× |
| Daily circuit breaker | Stops trading for the day at −3% |
| Weekly circuit breaker | Stops trading for the week at −6% |
| Correlation guard | At most one open position across highly correlated pairs, so EURUSD and GBPUSD cannot double the same bet |
| Max holding period | Force-closes a position after 5 days rather than letting a dead trade tie up risk budget |
The bot reconnects automatically when MT5 drops, retries initialisation instead of
exiting on first failure, and sends an hourly heartbeat if you have alerts on. For
unattended operation on a VPS, watchdog.bat restarts it if the process
dies outright.
Closed trades are appended to a CSV journal — never overwritten — and logs rotate so they cannot fill the disk. On startup the bot backfills any trades that closed while it was down, and it re-syncs periodically (every 15 minutes by default) so the journal stays accurate even across a crash.
If email is configured, you get a daily summary covering every signal generated, which filter blocked the ones that were not taken, the current indicator state per pair, and realised performance — win rate, profit factor, expectancy and drawdown — over both the last 24 hours and a rolling 30 days. The blocked-signal list is the genuinely useful part: it shows you what the bot saw and chose to skip.
Only needed if you want to modify the bot. The released executable requires none of this.
From a clone of the repository, on Windows:
powershell -ExecutionPolicy Bypass -File .\install_windows.ps1 -Build
The build produces a single dist\mt5bot.exe — a onefile build, with no
accompanying folder to copy alongside it.
That installs a suitable Python if the machine has none, creates the virtual
environment, installs the MetaTrader 5 package, verifies it imports, and builds
dist\mt5bot.exe.
MetaTrader 5 publishes win32 and win_amd64 wheels only —
there has never been an ARM64 build. On Windows-on-ARM,
winget installs the ARM64-native Python even when you explicitly ask
for x64, and pip then reports no matching distribution for MetaTrader5, which
reads like a broken version pin rather than the wrong interpreter. Install the
amd64 build from python.org and let it run under emulation. The setup script
handles all of this, and checks
sysconfig.get_platform() rather than platform.machine(),
because the latter reports the host CPU under emulation and so rejects an
interpreter that is perfectly correct.