Skip to main content

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 false unless noted. postOnly defaults to true — see Gotchas.

How to read the table

ColumnMeaning
PropertyThe JSON field name. Always camelCase on the wire.
TypeThe JSON value type. decimal = number, bool = boolean, int? = optional integer.
Requiredyes = must send on every trade; conditional = required when a sibling flag is set; no = optional.
DefaultValue applied when you omit the field. means no default.
CategoryLogical group. Maps to the detail page that explains the field in context.
DescriptionOne-line summary. Click the category to read the full explanation.

Master table

PropertyTypeRequiredDefaultCategoryDescription
exchangestringyescoreTarget exchange identifier. Determines which exchange receives the trade. Lowercase, hyphenated.
pairstringyescoreTrading 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).
isBuyboolconditionalfalsecoreMarks the signal as a long entry. Use this for normal webhook/manual TradeCommands. Mutually exclusive with isSell and isClose.
isSellboolconditionalfalsecoreMarks the signal as a short/ sell entry. Use this for normal webhook/manual TradeCommands. Mutually exclusive with isBuy and isClose.
isMarketboolnofalsecoreSends a market order. When false (and isLimit is true) TVH uses the price field as a limit price.
isCloseboolconditionalfalsecoreMarks the signal as a close-only action. Combined with closeLong / closeShort for hedge-mode flat commands.
isLimitboolnofalsecoreSends a limit order at price. Ignored when isMarket is true.
isStopLossboolnofalsecoreMarks the signal as a standalone stop-loss order (not an entry with attached SL). Used to add an SL to an existing position.
pricedecimalconditional0coreLimit price for non-market orders. Also the reference price for absolute stop-loss / take-profit calculations.
unitsdecimalconditional0sizingPosition size. Interpretation depends on unitsType (absolute base units, percent of balance, or risk-based).
stopLossdecimalconditional0stop-lossAbsolute stop-loss price. Required when stopLossType="absolute". Used as the reference for break-even and trailing offsets.
stopLossPercentdecimalconditional0stop-lossStop-loss distance in percent from entry. Required when stopLossType="percent".
stopLossTypestringnostop-lossHow to interpret stop-loss input. absolute = price level (or stopLossExpression), percent = distance from entry.
stopLossExpressionstringnostop-lossArithmetic 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.
takeProfitExpressionstringnotake-profitArithmetic 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.
tokenstringyescoreYour TVH User Token, a GUID that authenticates the webhook caller. Treat as a password.
leveragedecimalno0futuresLeverage 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.
targetsList<LimitOrder>notake-profitArray 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.
targetTypestringnopercenttake-profitSelects the target value field. percent = use targets[].takeProfitPercent; absolute = use explicit targets[].price levels (supports takeProfitExpression).
closeCurrentPositionboolnofalseclose-cancelClose the open position on the pair, regardless of direction. Combine with useLimitClose for a non-market exit.
marginTypestringnofuturesPer-pair margin mode for the trade. Switches the exchange setting before placing the order if required.
unitsTypestringnoabsolutesizingHow 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.
unitsPercentdecimalno0sizingConvenience 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.
useTrailingStopLossboolnofalsestop-lossConvert the stop-loss into a trailing stop. TVH manages the trail off-exchange where the exchange has no native primitive.
stopLossToBreakEvenboolnofalsestop-lossTrailing-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.
trailingStopLossPercentdecimalconditional0stop-lossTrail distance in percent. The stop follows price by this offset once activated.
trailingStopLossActivationPercentdecimalno0stop-lossProfit threshold (percent from entry) before the trailing stop arms. Below this threshold the SL stays at its initial level.
preventPyramidingboolnofalseconditionalHard guard: if a position is already open on the pair, reject the new entry. Prevents stacking on noisy alerts.
orderTypestringconditionalcoreTradingView strategy-alert direction field. Use orderType when mapping {{strategy.order.action}}; for normal webhook/manual TradeCommands use isBuy: true, isSell: true, or isClose: true.
reduceOnlyboolnofalsefuturesMark the order as reduce-only — it can shrink but never increase a position. Used by SL/TP follow-ups and trailing-stop logic.
postOnlyboolnotruefuturesReject 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.
strategyCommentstringnocoreMirrors 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.
useDcaboolnofalsedcaEnable the order-mesh entry style: initial market order plus N evenly-sized limit orders below (long) or above (short) entry.
dcaPercentdecimalconditional0dcaTotal spread of the DCA mesh from the initial entry, in percent. TVH spreads dcaOrderCount limits evenly across this range.
dcaOrderCountintconditional0dcaNumber of follow-up limit orders in the DCA mesh (not counting the initial market order).
limitPriceTypestringnofixedPricelimit-mgmtHow TVH derives the limit price. fixedPrice = use price verbatim. bestPrice = pin to the current best bid (buys) or best ask (sells) at submission time.
broadcastSignalstringnocoreName of the signal source to broadcast this trade to. Copy-trade followers of this source mirror the trade. Empty = no broadcast.
apiKeystringyescoreName of the exchange API key registered in your TVH dashboard. Routes the order to the correct credentials.
cancelAllDcaOrdersboolnofalseclose-cancelNot 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.
cancelAllOrdersboolnofalseclose-cancelCancel every open order on the pair (entries, DCA legs, TP, SL). Useful as a reset before a fresh setup.
hedgeModeboolnofalsefuturesBinance Futures dual-position mode. When true the account allows simultaneous long + short positions and routing uses positionSide instead of net direction.
closeLongboolnofalseclose-cancelHedge-mode helper: close only the long side. Required when the account is in dual-position mode and you want to flat one direction.
closeShortboolnofalseclose-cancelHedge-mode helper: close only the short side.
usePartialCloseboolnofalseconditionalClose only a portion of the current position instead of the whole thing. Size of the cut comes from partialCloseValue + partialCloseType.
partialCloseValuedecimalconditional0conditionalAmount to close. Interpretation set by partialCloseType (percent of position vs absolute units).
useFixedSizeboolnofalsesizingOverride units/unitsType with a fixed quote-currency amount from fixedQuoteSize. Useful for dollar-cost-style entries that ignore current balance.
fixedQuoteSizedecimalconditional0sizingQuote-currency amount when useFixedSize is true (e.g. 100 = $100 of BTC at the current mark price).
conditionalPyramidingboolnofalseconditionalSoft 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.
pyramidingValuedecimalconditional0conditionalMaximum 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.
conditionalAssetstringnoconditionalSelects 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.
targetAmountInPercentboolnofalsetake-profitWhen true, each target's amount is a percent share of the position. When false, amount is an absolute quantity in base units.
closeInProfitboolnofalseconditionalClose the existing position only if it is currently in profit by at least closeInProfitValue (percent). Useful for break-even-protective exits.
marginboolnofalsefuturesFlag 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.
useLimitCloseboolnofalselimit-mgmtWhen set together with a close command, exit the position using a limit order (price from price or chase logic) instead of a market order.
limitClosePercentdecimalno0limit-mgmtOffset (percent from current price) for the limit-close order. Positive value pushes the close price into profit territory.
partialCloseTypestringnopercentconditionalInterpret partialCloseValue as a percent of the position or as an absolute quantity.
partialCloseAssetstringnoquoteconditionalWhen partialCloseType="absolute", choose whether the value is denominated in the base or quote asset.
stopLossSizeTypestringnocurrentPositionstop-lossQuantity model for the SL order. currentPosition = size matches whatever fills (preferred), absolute = explicit quantity supplied via units.
cancelSlOrdersboolnofalsestop-lossCancel all existing stop-loss orders for the pair before placing the new entry/SL. Prevents duplicate SLs when re-entering.
workingTypestringnomarkfuturesBinance Futures only. Which price triggers SL/TP stop orders. mark is the index/mark price (safer); contract is the last trade price.
closeInProfitValuedecimalconditional0conditionalMinimum profit (percent) required before closeInProfit triggers the exit. Below the threshold the close is skipped.
delayintno0timingSeconds to wait before TVH forwards the signal to the exchange. Useful for staggered exits or letting the spread settle after news.
strategyCloseValuestringnocoreAdditional 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".
retriesintno1timingHow 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.
cancelAllDcaboolnofalseclose-cancelStandalone 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.
cancelAllboolnofalseclose-cancelStandalone command to cancel every pending order on the pair. Counterpart to cancelAllOrders when no entry is included.
cancelLimitOrderOffsetintno0limit-mgmtDelay 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).
useScaledOrdersboolnofalsedcaEnable 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.
scaledUpperPricedecimalconditional0dcaUpper 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.
scaledLowerPricedecimalconditional0dcaLower price bound of the scaled ladder.
scaledOrderNumbersintconditional0dcaNumber of limit orders to place across the upper/lower band.
scaledOrderStylestringnodcaSize 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.
scaledUseCurrentPriceboolnofalsedcaWhen true, treat the current mark/last price as one bound and use only scaledUpperPrice or scaledLowerPrice as the other bound (whichever is set).
updateCurrentLimitOrderboolnofalselimit-mgmtReposition 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.
instrumentTypestringnofuturesOKX-only product family. Controls which OKX endpoint is used for the order.
positionSidestringnonetfuturesOKX-only side tag. net for one-way mode, long or short when the account runs hedge-mode separately.
targetAssignedToPositionboolnofalsetake-profitBybit-only. When targets contains exactly one entry, attach it to the position as a TP-on-position instead of a standalone reduce-only order.
useEntireAccountBalanceboolnofalsesizingBybit UTA-only shortcut to size the entry using the full available balance after reservations. Ignores units and fixedQuoteSize.
chaseLimitOrderboolnofalselimit-mgmtRe-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.
updateLimitOrderBuyMarketAfterNotFilledboolnofalselimit-mgmtFallback to market order once the chase budget is exhausted. Otherwise the order is simply cancelled.
updateLimitOrderTimeIntervalintno20limit-mgmtSeconds to wait between chase attempts. Default 20 s; the chase runs for up to 180 attempts (~1 hour budget).
updateStopLossToBreakEvenboolnofalsestop-lossStandalone 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.
alertTimestampstringnotimingIdempotency 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}}".
setTpToPositionboolnofalsetake-profitBybit-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.

PropertyTypeRequiredDefaultDescription
idxintno0Position of the target inside the ladder. Used by the UI / activity log to label fills (TP1, TP2, ...). Zero-based.
pricedecimalyes0Absolute target price. Use when the parent TradeCommand has targetType=absolute. For targetType=percent, use takeProfitPercent instead.
amountdecimalyes0Size assigned to this target. Percent of position when targetAmountInPercent=true, otherwise absolute base-asset quantity.
takeProfitPercentdecimalno0Target distance in percent from entry. Use when the parent TradeCommand has targetType=percent. For targetType=absolute, use price instead.
trailingPercentdecimalno0Per-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.