Configure TradingView webhook alerts for OANDA

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

Step 1

Add strategy and create alert

Upload your Pine strategy, add it to the chart, and create a TradingView alert.

Strategy
TradingView strategy
Alert
TradingView alert
Step 2

Paste TradeAdapter message JSON

Update TradeAdapter key, OANDA User ID, and API token in the alert message.

Alert settings
TradingView alert settings
Step 3

Set OANDA webhook URL

Demo: https://tradeadapter.com/api/oanda/demo_order · Real: https://tradeadapter.com/api/oanda/real_order

Demo webhook
OANDA demo webhook
Real webhook
OANDA real webhook
JSON

TradingView alert message template

{
  "tradeadapter_key": "PUT YOUR TRADEADAPTER KEY HERE",
  "oanda_user_id": "PUT YOUR OANDA USER ID HERE",
  "oanda_api_token": "PUT YOUR OANDA API TOKEN HERE",
  "time": "{{timenow}}",
  "exchange": "{{exchange}}",
  "ticker": "{{ticker}}",
  "position_size": "{{strategy.position_size}}",
  "order_action": "{{strategy.order.action}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_price": "{{strategy.order.price}}",
  "order_id": "{{strategy.order.id}}",
  "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}}"
}