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.
- 8 min read
Give an AI agent access to your MT5 account safely
Connect Claude, ChatGPT or Cursor to a MetaTrader 5 account without handing over the keys: investor password, a read-only API key with an expiry, and llms.txt.
AI AgentsMetaTrader 5SecurityAPI Keys - 7 min read
Running MetaTrader 5 in Docker with Wine: what it took
How we run MetaTrader 5 headless in Docker with Wine, one account per container: the stack, the parts that broke, and whether you should build it yourself.
EngineeringMetaTrader 5DockerInfrastructure - 8 min read
Lot size calculator formula: pip value and sizing in MT5
The lot size calculator formula explained: pip value for USD pairs, crosses and gold, risk-based sizing with real numbers, and rounding to the broker's step.
Position SizingMetaTrader 5Risk ManagementCopy Trading - 8 min read
Profit factor, win rate, expectancy: what the numbers mean
Get the profit factor calculation, expectancy formula and win rate right, with a worked 10-trade example, sample-size limits, and what a real edge looks like.
Trading MetricsAnalyticsMetaTrader 5MT5 API - 8 min read
API key scopes: least privilege for trading accounts
Which API key scope to hand to dashboards, analysts, AI agents and CI, what a leaked read-only key can actually do, and a five-minute key audit routine.
SecurityAPI KeysMT5 APIBest Practices - 8 min read
EA trade copier vs cloud trade copier: which to run
Local EA trade copiers versus hosted cloud copiers, compared honestly: the failure modes that differ, real latency numbers, and who should use each one.
Trade CopierCopy TradingMT5Comparison - 8 min read
MT5 swap fees and commission: reading true trade costs
See where MT5 swap fees, commission, and fee land on deals, why net profit must sum all of them, and how to measure whether trading costs eat your edge.
MetaTrader 5Trading DataCostsMT5 API - 7 min read
Funded account risk management: a dashboard with MT5 alerts
Build one screen showing every funded account's distance to its daily and max drawdown limit, with an MT5 drawdown alert to Telegram before you breach.
Prop FirmFunded AccountRiskAlertsPython - 8 min read
Webhook retries, ordering, and idempotency: what to assume
What your webhook consumer must assume about retries, duplicates, and ordering, using MetaKit's real delivery numbers (5 attempts, 5s timeout) as the example.
WebhooksEngineeringReliabilityMT5 API - 8 min read
MT5 server time vs UTC: why your timestamps are off
MT5 server time is the broker's clock, not yours. Find the offset, convert MetaTrader 5 timestamps to UTC in pandas and JavaScript, and fix daily drawdown math.
MetaTrader 5TimezonesTrading DataProp Firms