Configure TradingView webhook alerts for MEXC

Complete the webhook step for tradingview webhook automation and route structured alerts from TradingView to MEXC through TradeAdapter.

Step 1

Add strategy and create TradingView alert

Attach your Pine strategy, validate backtest results, then create an alert for buy/sell events.

Strategy setup
TradingView strategy setup
Alert setup
TradingView alert setup
Step 2

Set webhook URL and message payload

Use your TradeAdapter webhook URL and JSON payload to route alerts from TradingView to MEXC with consistent execution.

Message
TradingView alert message JSON
Webhook URL
TradingView webhook URL notification
Step 3

Recreate alerts after strategy changes

Recreate TradingView alerts whenever strategy parameters change to keep real-time trade execution aligned.

JSON

TradingView alert message template

{
  "broker_api_key": "PUT YOUR MEXC API KEY HERE",
  "broker_api_secret": "PUT YOUR MEXC SECRET HERE",
  "real_order": "Yes / No",
  "order_market": "Spot",
  "order_type": "Market / Limit",
  "isolated_margin": "No",
  "exchange": "mexc",
  "ticker": "{{ticker}}",
  "time": "{{timenow}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_action": "{{strategy.order.action}}",
  "order_price": "{{strategy.order.price}}",
  "market_position": "{{strategy.market_position}}",
  "prev_market_position": "{{strategy.prev_market_position}}"
}