RoboQuant
Legacy · TradingView

Webhook Reference (Legacy)

Legacy TradingView path. Native compiled deployment does not use these webhooks — see Live deployment.

Reference for JSON alert messages sent from TradingView to RoboQuant.

Endpoint: POST https://trading-api.roboquant.dev/webhook/{token}

Your personal {token} is shown in the dashboard Webhooks tab.

Minimal payload

{
  "symbol": "ES",
  "side": "buy",
  "quantity": 1
}

Full field reference

FieldTypeRequiredDescription
symbolstringYesTrading symbol. Use {{ticker}} from TradingView
sidestringYes*buy, sell, close, or cancel_all
actionstringYes*TradingView alias for side (lowercased on ingest)
quantitynumberNoOrder size. Falls back to connection default
qtynumberNoAlias for quantity
contractsnumberNoFutures alias for quantity
order_typestringNomarket (default) or limit
pricenumberNoRequired for limit orders
accountIdstring/numberNoSingle Tradovate account
accountIdsarrayNoMultiple Tradovate accounts
accountsarrayNoPer-account configs (see below)
connectionIdstringNoSingle crypto connection UUID
connectionIdsarrayNoMultiple crypto connections
exchangestringNoCrypto broker type (binance, bybit, etc.)
quantityMultipliernumberNoMultiply default qty
fixedQuantitynumberNoOverride qty
stopLossnumberNoStop loss distance/value
takeProfitnumberNoTake profit distance/value
stopLossTypestringNoSL calculation mode
takeProfitTypestringNoTP calculation mode
riskPercentnumberNoRisk-based sizing (indicator mode)

*Either side or action must be present.

Strategy alert template

Generated by RoboQuant for Tradovate strategy deployment:

{
  "accountId": 12345678,
  "symbol": "{{ticker}}",
  "side": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "price": "{{strategy.order.price}}"
}

Indicator alert template

{
  "accountId": 12345678,
  "symbol": "{{ticker}}",
  "side": "buy",
  "quantity": 1,
  "price": "{{close}}"
}

Multi-account example

{
  "symbol": "{{ticker}}",
  "side": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "accounts": [
    { "accountId": 111, "quantityMultiplier": 1.0 },
    { "accountId": 222, "fixedQuantity": 2 }
  ]
}

TradingView variables

Strategy variables

VariableDescription
{{strategy.order.action}}buy or sell
{{strategy.order.contracts}}Order quantity
{{strategy.order.price}}Order price
{{strategy.position_size}}Current position size

Price & symbol

VariableDescription
{{ticker}}Chart symbol
{{close}}Bar close
{{open}}Bar open
{{high}}Bar high
{{low}}Bar low
{{time}}Bar timestamp

Plot variables (indicators)

VariableDescription
{{plot_0}}{{plot_19}}Values from plot() calls in script order

Side normalization

The connector lowercases side and accepts:

  • buy — open/increase long or buy to cover
  • sell — open/increase short or sell long
  • close — flatten position
  • cancel_all — cancel working orders

Response behavior

  • Valid token + payload → order routed to configured broker(s)
  • Results logged to webhook order logs in dashboard
  • Async mode may return 202 Accepted with alert_id for queue processing

Security notes

  • Never share your webhook URL publicly — it contains your secret token
  • Rotate token if exposed (regenerate in dashboard)
  • Use symbol whitelist and kill switch for production accounts
  • Test on paper / sim account first