Parameter Reference — All 84 Properties
A single sortable lookup of every field in the trade-command JSON.
TL;DR
- Use this page as a lookup. For learning, start with Anatomy and the category pages.
- Required = column says
yes. Conditional = required only when another flag is on (see the category page). - Default of
—means the field has no default — omitting it leaves the property null or zero. - Booleans default to
falseunless noted.postOnlydefaults totrue— see Gotchas.
How to read the table
| Column | Meaning |
|---|---|
| Property | The JSON field name. Always camelCase on the wire. |
| Type | The JSON value type. decimal = number, bool = boolean, int? = optional integer. |
| Required | yes = must send on every trade; conditional = required when a sibling flag is set; no = optional. |
| Default | Value applied when you omit the field. — means no default. |
| Category | Logical group. Maps to the detail page that explains the field in context. |
| Description | One-line summary. Click the category to read the full explanation. |
Master table
| Property | Type | Required | Default | Category | Description |
|---|---|---|---|---|---|
exchange | string | yes | — | core | Target exchange identifier. Determines which exchange receives the trade. Lowercase, hyphenated. |
pair | string | yes | — | core | 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 | core | Marks the signal as a long entry. Use this for normal webhook/manual TradeCommands. Mutually exclusive with isSell and isClose. |
isSell | bool | conditional | false | core | 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 | core | Sends a market order. When false (and isLimit is true) TVH uses the price field as a limit price. |
isClose | bool | conditional | false | core | Marks the signal as a close-only action. Combined with closeLong / closeShort for hedge-mode flat commands. |
isLimit | bool | no | false | core | Sends a limit order at price. Ignored when isMarket is true. |
isStopLoss | bool | no | false | core | 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 | core | Limit price for non-market orders. Also the reference price for absolute stop-loss / take-profit calculations. |
units | decimal | conditional | 0 | sizing | Position size. Interpretation depends on unitsType (absolute base units, percent of balance, or risk-based). |
stopLoss | decimal | conditional | 0 | stop-loss | Absolute stop-loss price. Required when stopLossType="absolute". Used as the reference for break-even and trailing offsets. |
stopLossPercent | decimal | conditional | 0 | stop-loss | Stop-loss distance in percent from entry. Required when stopLossType="percent". |
stopLossType | string | no | — | stop-loss | How to interpret stop-loss input. absolute = price level (or stopLossExpression), percent = distance from entry. |
stopLossExpression | string | no | — | stop-loss | Arithmetic expression evaluated by TVH to produce an absolute stop price (e.g. "3660-0.02*3660"). Supports Pine placeholders like {{strategy.order.price}}. Operator sign is auto-flipped based on orderType so the SL lands on the correct side. |
takeProfitExpression | string | no | — | take-profit | Arithmetic expression evaluated to produce the first target's absolute price (e.g. "{{strategy.order.price}}+0.02*{{strategy.order.price}}"). Operator sign auto-flips based on orderType. |
token | string | yes | — | core | Your TVH User Token, a GUID that authenticates the webhook caller. Treat as a password. |
leverage | decimal | no | 0 | futures | Leverage multiplier to apply before placing the order. TVH updates the exchange-side leverage for the pair only if the requested value differs from the current setting. |
targets | List<LimitOrder> | no | — | take-profit | Array of take-profit targets. Each entry is a LimitOrder with amount plus either price (absolute targets) or takeProfitPercent (percent targets), and optional trailing fields. Order matters — fills are processed in array order. |
targetType | string | no | percent | take-profit | Selects the target value field. percent = use targets[].takeProfitPercent; absolute = use explicit targets[].price levels (supports takeProfitExpression). |
closeCurrentPosition | bool | no | false | close-cancel | Close the open position on the pair, regardless of direction. Combine with useLimitClose for a non-market exit. |
marginType | string | no | — | futures | Per-pair margin mode for the trade. Switches the exchange setting before placing the order if required. |
unitsType | string | no | absolute | sizing | How to interpret units. absolute = base-asset quantity, percent = percent of available margin/balance, percentBalance = percent of total balance, percentWallet = percent of wallet equity, percentPosition = percent of current open position (close/scale-out only), risk = derive size from stopLoss distance. |
unitsPercent | decimal | no | 0 | sizing | Convenience field equivalent to units when unitsType="percent". Provided as a separate property so Pine alert messages can hard-code a percentage without flipping the type flag. |
useTrailingStopLoss | bool | no | false | stop-loss | Convert the stop-loss into a trailing stop. TVH manages the trail off-exchange where the exchange has no native primitive. |
stopLossToBreakEven | bool | no | false | stop-loss | Trailing-stop companion: when trailing SL is on, the stop locks at break-even (entry) once the trailing threshold is reached, instead of trailing further. Requires useTrailingStopLoss. Binance Futures and Bybit only. |
trailingStopLossPercent | decimal | conditional | 0 | stop-loss | Trail distance in percent. The stop follows price by this offset once activated. |
trailingStopLossActivationPercent | decimal | no | 0 | stop-loss | Profit threshold (percent from entry) before the trailing stop arms. Below this threshold the SL stays at its initial level. |
preventPyramiding | bool | no | false | conditional | Hard guard: if a position is already open on the pair, reject the new entry. Prevents stacking on noisy alerts. |
orderType | string | conditional | — | core | 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. |
reduceOnly | bool | no | false | futures | Mark the order as reduce-only — it can shrink but never increase a position. Used by SL/TP follow-ups and trailing-stop logic. |
postOnly | bool | no | true | futures | Reject the order if it would take liquidity (= ensures maker fee tier). Default is true in TVH; flip to false for limits that must fill aggressively. |
strategyComment | string | no | — | core | 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. |
useDca | bool | no | false | dca | Enable the order-mesh entry style: initial market order plus N evenly-sized limit orders below (long) or above (short) entry. |
dcaPercent | decimal | conditional | 0 | dca | Total spread of the DCA mesh from the initial entry, in percent. TVH spreads dcaOrderCount limits evenly across this range. |
dcaOrderCount | int | conditional | 0 | dca | Number of follow-up limit orders in the DCA mesh (not counting the initial market order). |
limitPriceType | string | no | fixedPrice | limit-mgmt | How TVH derives the limit price. fixedPrice = use price verbatim. bestPrice = pin to the current best bid (buys) or best ask (sells) at submission time. |
broadcastSignal | string | no | — | core | 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 | — | core | Name of the exchange API key registered in your TVH dashboard. Routes the order to the correct credentials. |
cancelAllDcaOrders | bool | no | false | close-cancel | Not an immediate cancel. A companion flag stored with the trade's trailing-stop record; when the trailing stop later closes the position, TVH also cancels the pair's remaining pending orders. Only meaningful alongside a trailing stop. For an immediate DCA-mesh cancel use cancelAllDca. |
cancelAllOrders | bool | no | false | close-cancel | Cancel every open order on the pair (entries, DCA legs, TP, SL). Useful as a reset before a fresh setup. |
hedgeMode | bool | no | false | futures | Binance Futures dual-position mode. When true the account allows simultaneous long + short positions and routing uses positionSide instead of net direction. |
closeLong | bool | no | false | close-cancel | Hedge-mode helper: close only the long side. Required when the account is in dual-position mode and you want to flat one direction. |
closeShort | bool | no | false | close-cancel | Hedge-mode helper: close only the short side. |
usePartialClose | bool | no | false | conditional | Close only a portion of the current position instead of the whole thing. Size of the cut comes from partialCloseValue + partialCloseType. |
partialCloseValue | decimal | conditional | 0 | conditional | Amount to close. Interpretation set by partialCloseType (percent of position vs absolute units). |
useFixedSize | bool | no | false | sizing | Override units/unitsType with a fixed quote-currency amount from fixedQuoteSize. Useful for dollar-cost-style entries that ignore current balance. |
fixedQuoteSize | decimal | conditional | 0 | sizing | Quote-currency amount when useFixedSize is true (e.g. 100 = $100 of BTC at the current mark price). |
conditionalPyramiding | bool | no | false | conditional | Soft guard: cap the position size on the pair. Stacking is allowed until the open position reaches pyramidingValue, then the new order is trimmed to the remaining capacity or rejected. Only inspects position size — no DCA-leg or order-count check. |
pyramidingValue | decimal | conditional | 0 | conditional | Maximum position size allowed on the pair for conditionalPyramiding. A base-asset quantity when conditionalAsset="base", otherwise a quote-currency value. Once reached, further entries are trimmed or rejected. |
conditionalAsset | string | no | — | conditional | Selects how pyramidingValue is read: base compares against the position's base-asset quantity, quote (or empty) against its quote-currency value. Always inspects the same pair's position, not a different asset. |
targetAmountInPercent | bool | no | false | take-profit | When true, each target's amount is a percent share of the position. When false, amount is an absolute quantity in base units. |
closeInProfit | bool | no | false | conditional | Close the existing position only if it is currently in profit by at least closeInProfitValue (percent). Useful for break-even-protective exits. |
margin | bool | no | false | futures | Flag used by spot-margin adapters to mark the trade as a margin order rather than plain spot. Currently consumed by KuCoin margin and similar adapters. |
useLimitClose | bool | no | false | limit-mgmt | When set together with a close command, exit the position using a limit order (price from price or chase logic) instead of a market order. |
limitClosePercent | decimal | no | 0 | limit-mgmt | Offset (percent from current price) for the limit-close order. Positive value pushes the close price into profit territory. |
partialCloseType | string | no | percent | conditional | Interpret partialCloseValue as a percent of the position or as an absolute quantity. |
partialCloseAsset | string | no | quote | conditional | When partialCloseType="absolute", choose whether the value is denominated in the base or quote asset. |
stopLossSizeType | string | no | currentPosition | stop-loss | Quantity model for the SL order. currentPosition = size matches whatever fills (preferred), absolute = explicit quantity supplied via units. |
cancelSlOrders | bool | no | false | stop-loss | Cancel all existing stop-loss orders for the pair before placing the new entry/SL. Prevents duplicate SLs when re-entering. |
workingType | string | no | mark | futures | Binance Futures only. Which price triggers SL/TP stop orders. mark is the index/mark price (safer); contract is the last trade price. |
closeInProfitValue | decimal | conditional | 0 | conditional | Minimum profit (percent) required before closeInProfit triggers the exit. Below the threshold the close is skipped. |
delay | int | no | 0 | timing | Seconds to wait before TVH forwards the signal to the exchange. Useful for staggered exits or letting the spread settle after news. |
strategyCloseValue | string | no | — | core | 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". |
retries | int | no | 1 | timing | How many times TVH re-sends an order when Binance returns an overload / server-busy response. Binance-specific overload guard, not a general cross-exchange retry; does not retry hard rejections or IP bans. Capped at 10. |
cancelAllDca | bool | no | false | close-cancel | Standalone trade command that cancels the pair's DCA mesh limit orders (TP/SL stay attached) and does nothing else. This is the field that actually clears a pending mesh immediately. |
cancelAll | bool | no | false | close-cancel | Standalone command to cancel every pending order on the pair. Counterpart to cancelAllOrders when no entry is included. |
cancelLimitOrderOffset | int | no | 0 | limit-mgmt | Delay in seconds after which TVH auto-cancels the still-pending entry/DCA limit orders on the pair. Only runs with isLimit=true and a value greater than 0. TP/SL orders are untouched. Capped at 604800 s (7 days). |
useScaledOrders | bool | no | false | dca | Enable scaled-orders ladder mode. Differs from DCA: you supply an explicit upper/lower price band rather than a percent spread, and there is no market component. |
scaledUpperPrice | decimal | conditional | 0 | dca | Upper price bound of the scaled ladder. For shorts this is the highest entry; for longs the worst (highest) limit if the ladder lays out top-down. |
scaledLowerPrice | decimal | conditional | 0 | dca | Lower price bound of the scaled ladder. |
scaledOrderNumbers | int | conditional | 0 | dca | Number of limit orders to place across the upper/lower band. |
scaledOrderStyle | string | no | — | dca | Size distribution style across the ladder. even = each leg the same size. bigSmall = larger legs at the better-priced side, smaller legs at the worse. smallBig = the inverse. |
scaledUseCurrentPrice | bool | no | false | dca | When true, treat the current mark/last price as one bound and use only scaledUpperPrice or scaledLowerPrice as the other bound (whichever is set). |
updateCurrentLimitOrder | bool | no | false | limit-mgmt | Reposition the open limit order nearest to market (not the most recent one) to the current best bid/ask. Cancels and re-places it, keeping size and leverage. Ignores price — it can only snap to the touch. |
instrumentType | string | no | — | futures | OKX-only product family. Controls which OKX endpoint is used for the order. |
positionSide | string | no | net | futures | OKX-only side tag. net for one-way mode, long or short when the account runs hedge-mode separately. |
targetAssignedToPosition | bool | no | false | take-profit | Bybit-only. When targets contains exactly one entry, attach it to the position as a TP-on-position instead of a standalone reduce-only order. |
useEntireAccountBalance | bool | no | false | sizing | Bybit UTA-only shortcut to size the entry using the full available balance after reservations. Ignores units and fixedQuoteSize. |
chaseLimitOrder | bool | no | false | limit-mgmt | Re-place the limit order at the moving best price until it fills, expires, or the chase budget runs out. Default budget: 180 attempts × 20 s = 1 hour. |
updateLimitOrderBuyMarketAfterNotFilled | bool | no | false | limit-mgmt | Fallback to market order once the chase budget is exhausted. Otherwise the order is simply cancelled. |
updateLimitOrderTimeInterval | int | no | 20 | limit-mgmt | Seconds to wait between chase attempts. Default 20 s; the chase runs for up to 180 attempts (~1 hour budget). |
updateStopLossToBreakEven | bool | no | false | stop-loss | Standalone command that moves an open position's existing SL to its average entry price (break-even). No new entry placed. Only fires when the position is in profit and already has an SL; not supported on every exchange. |
alertTimestamp | string | no | — | timing | Idempotency key. TVH builds a deduplication key from (token, apiKey-or-exchange, alertTimestamp) the first time it processes the payload; a later payload with the same triple is recognised as a duplicate and silently dropped. Recommended Pine value: "{{ticker}}-{{timenow}}". |
setTpToPosition | bool | no | false | take-profit | Bybit-specific. Attach take-profit orders to the position rather than as separate reduce-only limits. Required when entering via limit orders on Bybit's UTA. |
LimitOrder fields (used inside targets[])
These properties only appear inside an entry of the targets array. They are not top-level TradeCommand fields.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
idx | int | no | 0 | Position of the target inside the ladder. Used by the UI / activity log to label fills (TP1, TP2, ...). Zero-based. |
price | decimal | yes | 0 | Absolute target price. Use when the parent TradeCommand has targetType=absolute. For targetType=percent, use takeProfitPercent instead. |
amount | decimal | yes | 0 | Size assigned to this target. Percent of position when targetAmountInPercent=true, otherwise absolute base-asset quantity. |
takeProfitPercent | decimal | no | 0 | Target distance in percent from entry. Use when the parent TradeCommand has targetType=percent. For targetType=absolute, use price instead. |
trailingPercent | decimal | no | 0 | Per-target trailing offset. Once price reaches this target, the trailing logic for that slice arms with this distance. |
Download formats
The same dataset is published in two other shapes:
- Plain text for LLMs:
/llms-full.txt— every property as readable prose, no MDX, no tables. Drop into an LLM context window. - JSON Schema (Draft 2020-12):
/schemas/trade-command.schema.json— drop-in for structured-output tools and IDE validation.
Both stay in sync with the table above, so this reference always matches what the live webhook accepts.
Next
- Core parameters — the fields you'll touch on every trade.
- Examples — 12 complete Pine + JSON pairs.
- Gotchas — known footguns the table can't warn you about.