TradeLynkPRO

TradingView • MT5 Engine

Documentation & Syntax Reference

Webhook Alert Syntax & Parameters

Comprehensive guide to sending TradingView Pine Script alerts to MetaTrader 5 with TradeLynk. Supports both modern JSON and PineConnector text syntax.

Primary Ingestion Endpoint99.99% Uptime Relay
POSThttps://api.tradelynk.io/v1/webhook

Interactive Alert Payload Generator

Customize values below to generate your ready-to-copy TradingView webhook payload.

Ready Payload (Paste in TradingView Alert)JSON Format
{
  "key": "YOUR_SECRET_KEY",
  "action": "buy",
  "symbol": "EURUSD",
  "risk": 1,
  "sl": 25,
  "tp": 50,
  "be": 15,
  "comment": "TrendBreakout"
}

Webhook Parameters Reference

All parameters supported in TradeLynk JSON and text webhooks.

Parameter
Type
Requirement
Description & Example
key
String
Yes
Your unique 256-bit API Secret Key found in your TradeLynk terminal. e.g. "tl_live_83b92f0..."
action
String
Yes
Order action: buy, sell, close, closelong, closeshort, closeall, or cancel. e.g. "buy"
symbol
String
Yes
Asset ticker (e.g. EURUSD, BTCUSDT, US30, XAUUSD). Suffixes are auto-mapped. e.g. "EURUSD"
risk
Float
Optional*
Dynamic percentage of live account equity to risk (e.g. 1.0 = 1% balance). e.g. 1.0
lots
Float
Optional*
Static lot size. Used if 'risk' or 'cash' is not provided. e.g. 0.25
cash
Float
Optional*
Exact currency amount to risk on the trade (e.g. $150 or ₹10,000). e.g. 150.0
sl
Integer / Float
Recommended
Stop Loss distance in pips or exact price. Enforced for prop accounts. e.g. 25
tp
Integer / Float
Optional
Take Profit distance in pips or exact price. e.g. 50
be
Integer
Optional
Breakeven trigger: automatically moves Stop Loss to entry when in +X pips profit. e.g. 15
trail
Integer
Optional
Trailing stop distance in pips, locking in profit as price advances. e.g. 20
comment
String
Optional
Custom order label or strategy ID visible in MT5 trade history. e.g. "BreakoutAlgo_V2"

Pine Script Integration Examples

Easily attach TradeLynk webhook alerts to strategies or indicators in TradingView.

Strategy Alert Message (strategy.entry)Pine Script v5
//@version=5
strategy("TradeLynk EMA Breakout", overlay=true)

fastEMA = ta.ema(close, 9)
slowEMA = ta.ema(close, 21)

longSignal = ta.crossover(fastEMA, slowEMA)
shortSignal = ta.crossunder(fastEMA, slowEMA)

if (longSignal)
    strategy.entry("Long", strategy.long, alert_message='{
        "key": "your-tradelynk-secret-key",
        "action": "buy",
        "symbol": syminfo.ticker,
        "risk": 1.0,
        "sl": 25,
        "tp": 50,
        "be": 15
    }')

if (shortSignal)
    strategy.entry("Short", strategy.short, alert_message='{
        "key": "your-tradelynk-secret-key",
        "action": "sell",
        "symbol": syminfo.ticker,
        "risk": 1.0,
        "sl": 25,
        "tp": 50,
        "be": 15
    }')

Common MT5 Execution Errors & Troubleshooting

If an order fails to execute in your MT5 Experts tab, here is how to resolve it immediately.

10004 (TRADE_RETCODE_REQUOTE)

Cause: Broker requoted price during high volatility.

Solution: Increase slippage tolerance in your EA settings or use market execution.

10015 (TRADE_RETCODE_INVALID_PRICE)

Cause: Pending order price is too close to current bid/ask.

Solution: Check broker minimum freeze levels and stops distance.

10016 (TRADE_RETCODE_INVALID_STOPS)

Cause: Stop Loss or Take Profit is inside broker's minimum stop level.

Solution: Ensure SL distance is at least 5-10 pips above broker minimum spread.

10017 (TRADE_RETCODE_TRADE_DISABLED)

Cause: Algo trading is disabled or broker closed market.

Solution: Verify 'Algo Trading' button is enabled in MT5 toolbar and market is open.

10019 (TRADE_RETCODE_NO_MONEY)

Cause: Not enough free margin to open requested lot size.

Solution: Use dynamic risk % sizing or reduce static lot size.

Need Help with Custom Pine Script Syntax?

Our engineering team can assist you in converting complex indicator alerts into TradeLynk webhooks.

Open Support Ticket