MT5 API guides for developers
Working notes on connecting MetaTrader 5 to real software — REST endpoints, webhook delivery, copy-trading mechanics, and the constraints that actually bite in production.
- 7 min read
MT5 trailing stop: how it works and why it stops working
How to set a trailing stop in MT5, why it only works while your terminal is open, and how to run a server-side trailing stop that keeps trailing.
Trailing StopMetaTrader 5Risk ManagementMT5 API - 5 min read
PAMM vs MAM vs copy trading: managing client accounts
PAMM, MAM and copy trading compared: how each allocates trades and profit, who controls the money, broker lock-in, and which suits you.
Money ManagersCopy TradingPAMMMAM - 5 min read
Risk-reward ratio: the win rate you actually need
Risk-reward ratio explained: the break-even win rate for 1:1, 1:2 and 1:3, why planned R differs from realised R, and how to calculate yours.
Risk ManagementTrading MetricsPosition SizingTrading Basics - 5 min read
What is slippage in trading, and how to measure yours
Slippage in forex explained: positive vs negative slippage, why stops slip, when it spikes, the MT5 deviation setting, and how to measure yours.
SlippageOrder ExecutionTrading CostsMetaTrader 5 - 6 min read
How to keep a trading journal that fills itself in
What a forex trading journal should record, a free Google Sheets template, and how to auto-import every closed MT5 trade so you only add your notes.
Trading JournalGoogle SheetsMT5 APITrading Psychology - 9 min read
MT5 retcodes explained: why your order was rejected
A field guide to MT5 retcodes organised by the fix: invalid stops, invalid volume, not enough money, requotes, market closed, bad expiration and the rest.
MetaTrader 5MT5 APIOrder ExecutionTroubleshooting - 12 min read
Trade outcome webhook: grade MT5 trades on position.closed
Detect a stop loss hit, a target hit or a manual close the moment it happens with the position.closed webhook, and grade every signal without polling deals.
WebhooksTrading SignalsMT5 APINode.js - 9 min read
Idempotency keys stop a trading API filling twice
Why a trading API without idempotency keys will eventually fill an order twice, what a good key is, how replay works, and the retry policy that follows.
EngineeringMT5 APIOrder ExecutionReliability - 11 min read
Position size calculator API: lots from the symbol spec
Build a position size calculator on the MT5 API: turn cash at risk into a broker-valid lot size from tick_value, tick_size and volume_step, with real examples.
Position SizingRisk ManagementMT5 APITrading - 12 min read
Place an MT5 order over a REST API: the safe sequence
Place MT5 orders through a REST API without double fills: read the symbol spec, size to volume_step, re-quote, send with an idempotency key, handle 422 and 504.
MT5 APITradingTutorialOrder Execution