Core Parameters
The fields you touch on every single trade. Master these and you can place a market order; everything else in this section is optional refinement.
- Core fields for a normal webhook trade:
exchange,pair, one direction flag (isBuy,isSell, orisClose), sizing,apiKey, andtoken. - Use
isBuy: truefor long/buy entries andisSell: truefor sell/short entries. ReserveorderTypefor TradingView strategy alerts such as{{strategy.order.action}}. pairis exchange-native (BTCUSDTfor Binance,XBTUSDfor BitMEX,BTC-USDT-SWAPfor OKX). TVH does not normalise.tokenis your TVH user GUID andapiKeyis the name you gave the key in the dashboard, not the exchange-issued secret.
Most string and number-typed core fields accept Pine placeholders. The Pine alert template substitutes them before TradingView fires the webhook. See Anatomy → Dynamic values via TradingView placeholders for the list, or Pine Placeholders for the canonical reference.
Quick reference table
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
exchange | string | yes | — | Target exchange identifier. Determines which exchange receives the trade. Lowercase, hyphenated. |
pair | string | yes | — | Trading pair in exchange-native format. Each exchange has its own naming rules (e.g. BTCUSDT for Binance, BTC-USDT-SWAP for OKX, XBTUSD for BitMEX). |
isBuy | bool | conditional | false | Marks the signal as a long entry. Use this for normal webhook/manual TradeCommands. Mutually exclusive with isSell and isClose. |
isSell | bool | conditional | false | Marks the signal as a short/ sell entry. Use this for normal webhook/manual TradeCommands. Mutually exclusive with isBuy and isClose. |
isMarket | bool | no | false | Sends a market order. When false (and isLimit is true) TVH uses the price field as a limit price. |
isClose | bool | conditional | false | Marks the signal as a close-only action. Combined with closeLong / closeShort for hedge-mode flat commands. |
isLimit | bool | no | false | Sends a limit order at price. Ignored when isMarket is true. |
isStopLoss | bool | no | false | Marks the signal as a standalone stop-loss order (not an entry with attached SL). Used to add an SL to an existing position. |
price | decimal | conditional | 0 | Limit price for non-market orders. Also the reference price for absolute stop-loss / take-profit calculations. |
token | string | yes | — | Your TVH User Token, a GUID that authenticates the webhook caller. Treat as a password. |
orderType | string | conditional | — | TradingView strategy-alert direction field. Use orderType when mapping {{strategy.order.action}}; for normal webhook/manual TradeCommands use isBuy: true, isSell: true, or isClose: true. |
strategyComment | string | no | — | Mirrors TradingView's strategy.entry/exit(..., comment=...). TVH inspects the string for close tokens (close, exit, flat) to auto-trigger an exit, or for custom tokens listed in strategyCloseValue. |
broadcastSignal | string | no | — | Name of the signal source to broadcast this trade to. Copy-trade followers of this source mirror the trade. Empty = no broadcast. |
apiKey | string | yes | — | Name of the exchange API key registered in your TVH dashboard. Routes the order to the correct credentials. |
strategyCloseValue | string | no | — | Additional close token (or pipe-separated list) matched as a substring inside strategyComment, on top of the built-in close/exit/flat scan. It adds triggers, it does not replace the built-in ones. Example: "TP|SL|FLATTEN". |
Minimal working payload
The smallest possible trade command — a 0.01 BTC market buy on Binance Spot:
{
"exchange": "binance",
"pair": "BTCUSDT",
"apiKey": "binance-main",
"isBuy": true,
"units": 0.01,
"token": "YOUR_TOKEN"
}
isMarket is omitted but the trade still goes through as market because no limit flag is set and price is zero — TVH falls through to market.
Detail per property
exchange
| Attribute | Value |
|---|---|
| Type | string |
| Required | yes |
| Default | — |
| Auto-mapped | no |
| TV placeholder compatible | no |
Selects which exchange adapter receives the trade. Lowercase, hyphenated. Spot vs derivatives are separate identifiers — picking the wrong slug routes to the wrong adapter and the trade silently lands in the wrong market.
Allowed values (May 2026):
| Family | Identifiers |
|---|---|
| Binance | binance (spot), binance-futures (USDT-M), binance-futures-testnet, binance-futures-coin (COIN-M), binance-futures-coin-testnet |
| Bybit | bybit (derivatives, UTA), bybit-testnet, bybit-spot, bybit-spot-testnet |
| OKX | okx (derivatives + spot via instrumentType) |
| KuCoin | kucoin (futures), kucoin-spot |
| Coinbase | coinbase (perps), coinbase-spot |
| BitMEX | bitmex, bitmex-testnet |
Spot vs derivatives is always a separate slug.
Example:
{ "exchange": "binance-futures" }
Gotchas:
- Lowercase only.
Binance-Futuresis not accepted. - Testnet variants are separate exchange identifiers for Binance and BitMEX (e.g.
binance-futures-testnet). For Bybit and OKX, demo trading is enabled per-API-key via the Demo Account checkbox — samebybit/okxslug, different flag on the key. See Account & API Keys → Demo Account checkbox. - New exchange identifiers are added behind a flag — if a slug isn't in the list above, check
/docs/exchanges/for the latest catalogue.
See also: pair, apiKey, instrumentType.
pair
| Attribute | Value |
|---|---|
| Type | string |
| Required | yes |
| Default | — |
| TV placeholder compatible | yes — typically {{ticker}} |
Trading pair in exchange-native format. TVH passes the value through to the exchange without normalisation. Each exchange has its own naming rule.
| Exchange | Symbol format | Example |
|---|---|---|
| Binance Spot | BASEQUOTE (no separator) | BTCUSDT |
| Binance Futures USDT-M | BASEQUOTE | BTCUSDT |
| Binance Futures COIN-M | BASEUSD_PERP | BTCUSD_PERP |
| Bybit | BASEQUOTE | BTCUSDT |
| OKX | BASE-QUOTE-SWAP (perps) / BASE-QUOTE (spot) | BTC-USDT-SWAP |
| KuCoin Futures | XBTUSDTM (lots of suffixes) | XBTUSDTM |
| Coinbase Perps | BASE-USD-PERP | BTC-USD-PERP |
| BitMEX | XBTUSDT, XBTUSD | XBTUSDT |
Example with placeholder:
{ "pair": "{{ticker}}" }
Gotchas:
BTCUSDT, notBTC/USDT. The slash is a UI nicety from the exchange site, not a real symbol.- Coinbase perps use the
-PERPsuffix (or TradingView's.P, e.g.BTCUSD.P). Coinbase spot does not. - Wrong symbol returns "Invalid symbol" from the exchange and the trade is logged as failed in the Activity Log.
See also: exchange, instrumentType.
orderType
| Attribute | Value |
|---|---|
| Type | string |
| Required | conditional — only for TradingView strategy-alert templates |
| Allowed values | "buy", "sell", "close" |
| Default | — |
| Auto-mapped | strategy-alert helper that can set isBuy/isSell/isClose/isMarket/chaseLimitOrder — see Anatomy |
| TV placeholder compatible | yes — typically {{strategy.order.action}} |
orderType is for TradingView strategy alerts, especially when mapping {{strategy.order.action}}. For normal webhook/manual TradeCommands, use isBuy: true, isSell: true, or isClose: true directly.
Example with Pine placeholder (reusable for buy and sell):
{
"orderType": "{{strategy.order.action}}"
}
When TradingView fires the alert, {{strategy.order.action}} is replaced with the literal string "buy" or "sell" based on which side the Pine strategy ordered. No conditional Pine logic needed.
Gotchas:
- Case-insensitive on the wire but lowercase is conventional.
"close"forcesisMarket=trueunlessuseLimitCloseis also set. See Limit Order Management → useLimitClose and Close & Cancel.- The
strategyCommentauto-close logic can override the direction implied byorderType. See Anatomy → strategyComment auto-close.
See also: isBuy / isSell / isClose, strategyComment.
isBuy / isSell / isClose
| Attribute | Value |
|---|---|
| Type | bool |
| Required | conditional — choose one direction flag for normal webhook/manual commands |
| Default | false |
| Auto-mapped | can be derived from orderType in TradingView strategy-alert mode |
Mutually-exclusive booleans for direction. These are the normal fields for webhook/manual TradeCommands:
{ "isBuy": true }
Use isSell: true for sell/short entries and isClose: true for close commands. Avoid sending both orderType and direction booleans in basic examples; orderType belongs to strategy-alert templates.
See also: orderType, isMarket / isLimit.
isMarket / isLimit
| Attribute | Value |
|---|---|
| Type | bool |
| Required | no |
| Default | false |
Selects the order type. Mutually exclusive, but set neither and the default is market because price=0 falls through to market dispatch in most adapters.
Limit order:
{
"isLimit": true,
"price": 65000.0
}
Market order (explicit):
{ "isMarket": true }
isLimit is ignored when isMarket=true. For a limit close, see useLimitClose — that bypasses the auto-mapping that would otherwise force a market exit.
See also: price, limitPriceType, chaseLimitOrder.
isStopLoss
| Attribute | Value |
|---|---|
| Type | bool |
| Required | no |
| Default | false |
Marks the entire payload as a standalone stop-loss order, not an entry with attached SL. TVH skips the entry path and just places (or replaces) an SL on the existing position.
Use case: a follow-up TradingView alert that adjusts the stop on an already-open position.
{
"exchange": "binance-futures",
"pair": "BTCUSDT",
"apiKey": "binance-futures-main",
"isStopLoss": true,
"cancelSlOrders": true,
"stopLossType": "absolute",
"stopLoss": 64200,
"stopLossSizeType": "currentPosition",
"token": "YOUR_TOKEN"
}
See also: stopLoss, stopLossType, updateStopLossToBreakEven.
price
| Attribute | Value |
|---|---|
| Type | decimal |
| Required | conditional (when isLimit=true) |
| Default | 0 |
| TV placeholder compatible | yes — typically {{close}} or {{strategy.order.price}} |
Limit price for non-market orders. Also the reference price for absolute-mode stop-loss and take-profit calculations on adapters that need an explicit price (e.g. when stopLossType="absolute" and stopLossExpression is empty).
{
"isLimit": true,
"price": "{{close}}"
}
Gotchas:
- For market orders,
priceis irrelevant — leave at0. - When
limitPriceTypeis"bestPrice", thepricefield is overridden by TVH at submission time with the current best bid (buys) or best ask (sells).
See also: isMarket / isLimit, limitPriceType, stopLoss.
token
| Attribute | Value |
|---|---|
| Type | string (GUID) |
| Required | yes |
| Default | — |
| TV placeholder compatible | no |
Your TVH user token — the GUID that identifies which TVH account the webhook belongs to. Treat it like a password.
{ "token": "YOUR_TOKEN" }
Where to find it: Account → Settings. The token is also embedded in your personal webhook URL (the path segment after /api/trade/). TVH renders the URL with the token pre-filled — copy from there.
Gotchas:
- Never log the token. Never check it into a public Pine script.
- Rotate immediately if leaked — every account inherits trading authority through this single value.
- Sharing a Pine script publicly? Use the webhook URL with the token in the path (TVH still validates it), and tell users to paste their own token.
See also: apiKey, Webhook URLs and IP.
apiKey
| Attribute | Value |
|---|---|
| Type | string |
| Required | yes |
| Default | — |
| TV placeholder compatible | no |
The name you gave the exchange API key when you added it in Account → Settings → API Keys. Not the exchange-issued key itself.
{ "apiKey": "binance-futures-main" }
apiKey is how TVH knows which credentials to dispatch the trade with. One TVH account can have many API keys across many exchanges — apiKey disambiguates.
Gotchas:
- Case-sensitive.
Binance-Mainis notbinance-main. - The exchange-issued API key and secret are stored encrypted in TVH and never appear in the JSON.
See also: token, Sub-accounts, Account & API Keys.
Routing helpers (also "core")
These three fields live in the routing group but are conventionally set alongside the core fields. They're optional.
There is no working subAccount payload field. To route to an exchange sub-account, register one TVH API key per sub-account and select it with apiKey. See Sub-accounts.
broadcastSignal
| Attribute | Value |
|---|---|
| Type | string |
| Required | no |
| Default | "" |
Name of the signal source to broadcast this trade to. Copy-trade followers of this source mirror the trade. Empty = no broadcast.
{ "broadcastSignal": "alpha-scalper" }
See also: Copy Trading overview.
strategyComment
| Attribute | Value |
|---|---|
| Type | string |
| Required | no |
| Default | "" |
| Auto-mapped | yes — triggers close path if string contains close / exit / flat |
| TV placeholder compatible | yes — typically {{strategy.order.comment}} |
Mirrors TradingView's strategy.entry(..., comment=...) and strategy.exit(..., comment=...). TVH scans the string for close tokens. This is one of the most surprising auto-mappings — read Anatomy → strategyComment auto-close before using.
{ "strategyComment": "{{strategy.order.comment}}" }
To bypass the default close|exit|flat substrings, set strategyCloseValue to your own token.
strategyCloseValue
| Attribute | Value |
|---|---|
| Type | string (pipe-separated list) |
| Required | no |
| Default | "" |
Custom token (or pipe-separated list) used to detect close intent inside strategyComment. Example: "close|exit|flat|stop" — any substring match triggers a close.
When set, only your tokens trigger close — the default close|exit|flat substrings are no longer scanned.
Putting it together
A realistic core block before adding sizing or risk parameters:
{
"exchange": "binance-futures",
"pair": "{{ticker}}",
"apiKey": "binance-futures-main",
"orderType": "{{strategy.order.action}}",
"isMarket": true,
"strategyComment": "{{strategy.order.comment}}",
"alertTimestamp": "{{ticker}}-{{timenow}}",
"token": "YOUR_TOKEN"
}
That payload works for both long and short entries (via {{strategy.order.action}}) and automatically closes on Pine strategy.exit(...) calls (via {{strategy.order.comment}}).
Next
Now that you have the routing and direction down, move to Sizing to control how big the trade is.