Use forex symbols on TradingView
Choose the forex symbol you want to route to MetaTrader 4 or MetaTrader 5.
Add your Pine strategy to the chart
Open Pine Editor, add or paste your strategy, then press Add to chart.
Create a TradingView strategy alert
Verify backtest results in Strategy Tester, then create an alert for buy/sell events.
Set alert message and webhook URL
Paste JSON from the template below or use the Message Generator. Add your TradeAdapter webhook URL from your profile page.
Monitor signals on MetaTrader MyTrades
If orders do not appear in MT4/MT5, check the MetaTrader MyTrades page for execution status.
TradingView alert message template
What the Expert Advisor does and how the pieces fit together: TradingView to MT5 and MT4 automation.
{
"mt_trading_account": "Put here your MT4/5 Trading Account Number",
"platform": "metatrader",
"time": "{{timenow}}",
"ticker": "{{ticker}}",
"order_type": "Market",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.order.action}}",
"order_price": "{{strategy.order.price}}",
"target_type": "none/percentage/pips",
"stop_loss": "Put SL value like 0.1 / 0.01 / 0.002",
"take_profit": "Put TP value like 0.1 / 0.01 / 0.002",
"market_position": "{{strategy.market_position}}",
"market_position_size": "{{strategy.market_position_size}}",
"prev_market_position": "{{strategy.prev_market_position}}",
"prev_market_position_size": "{{strategy.prev_market_position_size}}",
"strategy_number": "1"
}
Note: order_contracts must be in lots. Recreate the alert whenever you change Pine strategy parameters.