Skip to main content

Bybit — Futures (UTA), Spot, Demo Account

Bybit's Unified Trading Account (UTA) keeps Spot, Futures, and Options under a single balance. TVH supports both the futures and spot identifiers, plus the cleanest Demo experience of any exchange we connect to — one checkbox, no separate website.

TL;DR
  • 4 exchange identifiers: bybit, bybit-testnet, bybit-spot, bybit-spot-testnet
  • Demo Account checkbox works for both Spot and Futures
  • Hedge Mode works when your Bybit account is set to it — buy/sell open each side automatically, no hedgeMode param needed
  • Three Bybit-only TP-attach fields: setTpToPosition (limit-entry path), targetAssignedToPosition (market-entry path), and useEntireAccountBalance (UTA-wide sizing)
  • All variants use https://alerts.tv-hub.org
Open Bybit accountAffiliate link — TradingView Hub may earn a commission at no cost to you.
Test on Bybit demo first

Bybit demo is the cleanest paper-trading path we support — one checkbox, no separate site, real market prices. Full setup: Demo Accounts → Bybit.

Variants

Bybit Futures (Unified Trading Account)

FieldValue
Exchange identifierbybit
Webhook URLhttps://alerts.tv-hub.org
Symbol formatBTCUSDT (linear/USDT-margined perpetuals)
Max leverage100× (cumulative across UTA)
PermissionsRead + Derivatives Trade (Unified Trading)
Sub-account support✅ via named apiKey field (one TVH key per UTA sub-account)
Demo support✅ Demo Account checkbox

Webhook URL:

Example payload (UTA-wide sizing):

{
"token": "your-tvh-token",
"exchange": "bybit",
"pair": "BTCUSDT",
"isMarket": true,
"isBuy": true,
"units": 50,
"unitsType": "percentBalance",
"leverage": 5,
"marginType": "cross",
"useEntireAccountBalance": true
}

useEntireAccountBalance — UTA-only

Setting "useEntireAccountBalance": true tells TVH to size against the entire UTA balance (Spot + Derivatives combined), not just the perpetuals wallet. Useful when you keep most of your collateral as spot USDT and want futures sizing to account for it.

This flag is Bybit-only. Other exchanges ignore it.

setTpToPosition and targetAssignedToPosition — Bybit-only TP-attach flags

Bybit uses two separate flags depending on the entry type. They are distinct fields in the trade-command schema:

FieldOrder type
targetAssignedToPositionMarket entries — attach a single TP to the position at order time
setTpToPositionLimit entries — attach a single TP to the position once the limit fills

Both require targets.length === 1. They are not interchangeable — using the wrong flag for your entry type silently degrades to the default behaviour (separate reduce-only TP orders).

Limit-order example (uses setTpToPosition):

{
"exchange": "bybit",
"pair": "BTCUSDT",
"isBuy": true,
"isMarket": false,
"price": 60000,
"units": 0.1,
"stopLoss": 58000,
"stopLossType": "absolute",
"targetType": "absolute",
"targetAmountInPercent": true,
"targets": [{ "price": 65000, "amount": 100 }],
"setTpToPosition": true,
"apiKey": "bybit-demo",
"token": "YOUR_TOKEN"
}

Market-order example (uses targetAssignedToPosition):

{
"exchange": "bybit",
"pair": "BTCUSDT",
"isBuy": true,
"isMarket": true,
"units": 0.1,
"stopLoss": 58000,
"stopLossType": "absolute",
"targetType": "absolute",
"targetAmountInPercent": true,
"targets": [{ "price": 65000, "amount": 100 }],
"targetAssignedToPosition": true,
"apiKey": "bybit-demo",
"token": "YOUR_TOKEN"
}

Pros (both flags): one fewer pending order, no race condition between the entry fill and the reduce-only TP. Cons: single TP only.

API key creation

Bybit supports third-party binding — you authorise TVH directly when creating the key, so no IP whitelist is needed.

  1. Log in at bybit.com → top-right account icon → API.

    Bybit account menu — open API

  2. Click Create New KeySystem-generated API Keys.

    Bybit API Management — Create New Key

  3. Choose Connect to Third-Party Application, then select tv-hub.org from the list.

    Bybit connect to third-party application — select tv-hub.org

  4. On the key form, make sure tv-hub.org is the selected third-party app in the dropdown, then set the permissions to Read-Write (Unified Trading → Trade); leave withdrawals off.

    Bybit API key — tv-hub.org bound in the dropdown, Read-Write permissions

  5. Pass the security check / 2FA and click Submit.

    Bybit API key confirm and submit

  6. Copy the Key + Secret (shown once) into TVH at Account → Settings → API Keys.

    Bybit API key and secret

Common Bybit quirks

  • UTA must be activated. New accounts default to "Classic"; TVH expects UTA. Activate it from Bybit's account settings before generating the API key.
  • One-way vs Hedge. This is set on the account (Bybit position-mode setting), not in the payload. In hedge mode, orderType: "buy" opens/extends the long and orderType: "sell" the short, and closeLong/closeShort flatten one side — TVH routes the position index automatically. The Binance-style "hedgeMode": true field is ignored on Bybit; you don't need it.
  • Use the right TP-attach flag. setTpToPosition is the limit-entry flag (TP attaches after the limit fills). targetAssignedToPosition is the market-entry flag (TP is attached when the market order is placed). Using the wrong one silently falls back to the default separate-reduce-only behaviour.
  • Time-in-force defaults differ from Binance. TVH normalizes this — you don't need to set it explicitly.
  • API-key TTL. Bybit keys expire after 90 days unless you re-confirm. TVH does not auto-rotate; you'll get 401s when the key expires.

Feature support

FeatureFutures (UTA)Spot
Multiple TPs✅ (or ⚠️ 1 TP with setTpToPosition / targetAssignedToPosition)
Trailing Stop
Scaled Orders
Hedge Mode✅ Account-level (set on Bybit; no param)n/a
useEntireAccountBalance
setTpToPosition (limit entries)n/a
targetAssignedToPosition (market entries)n/a
useFixedSize
Sub-Accounts (via named apiKey)
Demo Account checkbox

Full matrix: Exchange Quirks Reference.