Back to Documentation
MQL5 Expert Advisor

MT5 to Tradyn
Trade Copier

Expert Advisor that copies trades from MetaTrader 5 to Tradyn in real-time with full position mapping, symbol conversion, and volume scaling.

Requires
MT5 Build 2500+
Connects To
127.0.0.1:8080
Detection
Instant (event-based)

Instant Detection

OnTradeTransaction() for real-time detection — no polling delays.

Position Mapping

Tracks MT5 → Tradyn IDs with file persistence for accurate closing.

Symbol Mapping

Map broker symbols (e.g., XAUUSD.c → XAUUSD) automatically.

Volume Multiplier

Scale position sizes up or down with a configurable multiplier.

SL/TP Sync

Copies stop loss and take profit, including live modifications.

Debug Logging

Verbose logging mode for troubleshooting in the MT5 Experts tab.

How It Works

Trade Detection
Flow

The EA uses MQL5's OnTradeTransaction() event for instant trade detection — no polling, no delays.

Position Mapping: The EA maintains TradynCopier_Mappings.csv to track MT5 Position ID → Tradyn Position ID for accurate closing.

1
MT5 Trade Executed
2
OnTradeTransaction() triggered (instant)
3
Detect DEAL_ENTRY_IN (open) or DEAL_ENTRY_OUT (close)
4
Map symbol if needed
5
Calculate volume with multiplier
6
Send HTTP request to Tradyn API
7
Save/Remove position mapping

Installation

Four steps to get trades copying from MT5 to Tradyn.

1

Copy EA to MT5

Copy the compiled EA file to your MetaTrader 5 data folder.

File structure
MQL5/
└── Experts/
    └── TradynCopier.ex5

To find your data folder: In MT5, go to File → Open Data Folder

2

Allow WebRequest

Enable HTTP requests in MetaTrader 5 settings.

  1. 1Go to Tools → Options → Expert Advisors
  2. 2Check "Allow WebRequest for listed URL"
  3. 3Add: 127.0.0.1 (just the IP, no http:// or port)
  4. 4Click OK

MT5 only accepts domain names or IPs in the whitelist, not full URLs.

3

Enable Tradyn API Server

Turn on the API server in Tradyn Terminal.

  1. 1Click the API Server button in the toolbar
  2. 2Turn on the server
  3. 3Copy the API Key
4

Attach EA to Chart

Attach the EA to any chart and configure it.

  1. 1In MT5, drag TradynCopier onto any chart
  2. 2Set API URL: http://127.0.0.1:8080 (default)
  3. 3Paste your API Key from Tradyn
  4. 4Click OK

Configuration

EA input parameters and their defaults.

Input Parameters

Configure in the EA Inputs tab

ParameterDefaultDescription
API Connection
API URLhttp://127.0.0.1:8080Tradyn API server URL
API Key(empty)Your API key from Tradyn Terminal
Trade Settings
Volume Multiplier1.0Scale volume (0.5 = half, 2.0 = double)
Copy SLtrueCopy Stop Loss to Tradyn
Copy TPtrueCopy Take Profit to Tradyn
Copy ModifytrueSync SL/TP modifications
Symbol Mapping
Symbol Map(empty)Comma-separated mappings (see below)
Debug
Debug ModefalseEnable verbose logging

Symbol Mapping

Map broker-specific symbol names

XAUUSD.c=XAUUSD,EURUSD.c=EURUSD,GBPUSD.c=GBPUSD

Format: MT5Symbol=TradynSymbol separated by commas.

Volume Multiplier

Scale position sizes

0.5×1.0 lot0.5 lot
1.0×1.0 lot1.0 lot
2.0×1.0 lot2.0 lot
0.1×1.0 lot0.1 lot

Troubleshooting

Click an issue to see the solution.

Ready to copy trades?

Download the EA, configure your settings, and start copying trades from MT5 to Tradyn in minutes.

MetaTrader 5 (MT5) and MetaQuotes are registered trademarks of MetaQuotes Ltd. Tradyn is not affiliated with, endorsed by, or sponsored by MetaQuotes Ltd. The MT5 Copier EA is an independent integration tool developed by Tradyn to facilitate trade copying between MetaTrader 5 and the Tradyn platform.