Why your TradingView webhook
orders open at the wrong size
qty_type=usdt vs margin_usdt — the semantic trap explained
Your TradingView alert sends qty: 20 with leverage: 3. You expect a $60 position. The exchange opens $20. This isn't a bug — it's a perpetual qty_type semantic trap that eats a lot of automation users. This post walks through a real Binance fill, breaks down the five sizing modes, and shows the Pine alert pattern that avoids it.
qty_type=usdt meansqty IS the notional position value (leverage only affects margin requirement, doesn't amplify the position). To get the retail-intuitive "20 USDT × 3x leverage = $60 position", useqty_type=margin_usdt. Three-second fix: change"qty_type": "usdt" to"qty_type": "margin_usdt" in your payload.Real case: NEAR perpetual test order
A TVSBot user set up a TradingView Alert for a 1-hour short-term strategy:
{
"secret": "...",
"strategy": "NEAR-test",
"side": "buy",
"symbol": "NEARUSDT",
"exchange": "binance",
"market_type": "futures",
"order_type": "market",
"qty_type": "usdt",
"qty": 20,
"leverage": 3
}Expected: 20 USDT × 3x leverage = 60 USDT position. Actual Binance fill:
Quantity / Filled (USDT): 19.592 / 19.592
Avg Price / Price: 2.449 / Market
Fee: 0.00001478 BNBPosition is just $19.6 notional (~8 NEAR × $2.449). Leverage 3x didn't multiply it to $60. Looks like "leverage didn't work", but leverage actually did work — it just affects the margin requirement, not the position size.
Why this is counterintuitive
Retail traders typically think: "I have 20 USDT, I want to open a position and use 3x leverage to amplify it to $60." This intuition maps to themargin view — you post X dollars of margin, the exchange gives you Y× exposure.
But the exchange API view is different. When placing a perpetual order, you directly tell the exchange "open an N USDT notional position". Leverage is a separate parameter that only decides how much margin gets locked for that notional. So:
# Exchange API semantics (the qty_type=usdt interpretation)
notional = qty # 20 means $20 notional
margin = notional / leverage # auto-calculated: $20/3 ≈ $6.67Result: ~$6.67 margin locked, $20 position opened, 3x leverage.Perfectly correct from the exchange's perspective.But completely different from your mental "20 × 3 = $60 exposure" model.
The five qty_type modes side by side
TVSBot supports five qty_type modes. Same scenario (qty=20, leverage=3, symbol=BTCUSDT at $50,000):
| qty_type | What qty means | Actual position | Margin |
|---|---|---|---|
| ⭐ margin_usdt | Margin in USDT | $60 | $20 |
| margin_pct | % of balance as margin | depends on balance | balance × X% |
| fixed | Fixed quantity (base units) | 20 × $50,000 = $1M ⚠️ | $333,333 |
| percent | % of USDT balance | balance × 20% | balance × 20% / lev |
| ⚠️ usdt | Position notional | $20 | $6.67 |
The point isn't which is "correct" —all five are correct. The difference iswhich mental model you want to calculate in.
Why this trap isn't just a TVSBot thing
Nearly every TradingView-to-exchange automation bridge has this semantic trap. The only difference is "who blocks you from stepping on it":
3Commas
DCA bots use the "margin USDT × leverage" logic, but the SmartTrade API'sunits field is base-currency units, and switching to USDT is yet another interpretation. Inconsistent semantics across products on the same platform is a common pitfall.
TradingConnector / Pine native strategy.order
Pine's strategy.order(qty=X) is base units in backtest, but when wired to an auto-execution webhook often needs manual translation into notional/margin — the first suspect when someone's backtest equity curve doesn't match live trading is usually this.
Hand-rolled CCXT bots
create_order(amount=X) means different things per exchange: Binance Futures USDT-M takes base units, COIN-M takes contracts, OKX swap has its own contract size. No automation bridge escapes this translation layer.
How TVSBot guards against it
This month (June 2026) we made three changes to keep new users from stepping on it:
1. Strategy editor dropdown promotes margin_usdt as the recommended futures default, marked with ⭐ and labeled "Margin USDT (recommended: post X USDT × leverage)". The plain usdt option is now labeled "Position USDT (advanced: direct notional)".
2. Selecting usdt shows an inline amber warning: "Position fixed at $X, leverage only affects margin requirement (does not amplify position)". Selecting margin_usdt shows a green live formula: "Posts $20 margin × 3x → Position = $60". See the number before you commit.
3. Marketplace publish form mirrors this: strategy authors setting signal defaults also see margin_usdt at the top with a placeholder reading "20 (margin, × leverage = position)". Subscribers following a KOL's strategy land on the intuitive path naturally.
The three-second fix
# Change your TradingView Alert payload to:
{
"secret": "...",
"strategy": "NEAR-test",
"side": "buy",
"symbol": "NEARUSDT",
"exchange": "binance",
"market_type": "futures",
"qty_type": "margin_usdt", // ← change this line
"qty": 20,
"leverage": 3
}
# Result: $20 margin, $60 position, 3x leverage ✓Next alert fires, Binance will show a correct $60 notional. No Pine changes, no backtest changes — just this one string.
Two related variants people also trip on
Variant 1: Does margin_pct=100 mean "100" or "100%"?
Answer: TVSBot's margin_pct: 10 means "use 10% of balance", not $10. If you write margin_pct: 100, you're posting yourentire balance as margin with the configured leverage on top. Easy way to blow up.
Variant 2: fixed units on perpetuals
Binance USDT-M futures' fixed qty is "number of BTC". So qty_type=fixed, qty=20 on BTC means "20 BTC", and at $50k each that's a $1M notional position. Wrong moves usually get rejected by the exchange (above leverage limit), but occasionally slip through on small alts (like NEAR) and blow up the same day. Always test fixed on testnet first.
How to verify your setup is correct
Use all three for maximum safety:
- TVSBot dry-run mode: enable dry-run on the strategy. After a TV alert fires, check the dashboard signal detail page for the "resolved qty" field — that's the actual number that would be sent.
- Small live capital: try the minimum unit first. Check the exchange's fill window "notional value" field matches your expectation.
- TVSBot signal notification: after a successful order, the TG / app notification shows
notional $X / margin $Y. If that matches your mental model, you're fine.
Get started
TVSBot is a non-custodial TradingView → exchange automation bridge, supporting Binance / OKX / Bitget / Bybit / Gate / BingX / Hyperliquid (7 exchanges). This month's qty_type UX overhaul puts the intuitive option first and surfaces real-time warnings on the counterintuitive ones.
Start 3-day free trial