Bitget
Bitget (Spot): Bitget spot, for unified accounts (UTA; choose v3 for the "Version" option, the default) and classic accounts (choose v2). A Bitget API key is required: Access Key, Secret Key and Passphrase.
Futures_Bitget (Futures): Bitget USDT and USDC perpetual contracts, and coin-margined perpetual and delivery contracts. Supports unified accounts (UTA; choose v3 for the "Version" option, the default) and classic accounts (choose v2). A Bitget API key is required: Access Key, Secret Key and Passphrase.
Names and Configuration
exchange.GetName() | Type |
|---|---|
Bitget | Spot |
Futures_Bitget | Futures |
| Field | Required |
| - | - |
| Access Key | Yes |
| Secret Key | Yes |
| Passphrase | Yes |
| Version | Yes |
| Simulate | No |
Trading Pairs and Contract Codes
Bitget (Spot)
Pair examples: BTC_USDT, ETH_BTC
Pairs are written as BTC_USDT without a contract code; use a Futures_Bitget exchange object for contracts.
Futures_Bitget (Futures)
Pair examples: BTC_USDT, BTC_USDC, BTC_USD
The quote currency selects the contract family: BTC_USDT and BTC_USDC are USDT- and USDC-settled contracts (the USDC perpetual is Bitget's BTCPERP), BTC_USD is coin-margined. In demo trading every coin name has an S prefix, for example SBTC_SUSDT, SBTC_SUSDC, SBTC_SUSD.
| Contract code | Description |
|---|---|
swap | Perpetual contract (the default). |
quarter | Current-quarter delivery contract (coin-margined). |
next_quarter | Next-quarter delivery contract (coin-margined). |
Native contract code examples: BTCUSDU26, ETHCMZ26
Delivery contracts can also be given by their Bitget native code, for example BTC_USD.BTCUSDU26; coin-margined delivery codes on a unified account (v3) look like ETHCMZ26.
Exchange-specific IO Commands
Bitget (Spot)
| Command | Arguments | Description | Returns |
|---|---|---|---|
simulate | bool | Switch between demo (true) and live (false) trading; demo requests carry the paptrading header, the API address stays the same. | The value set. |
For the common commands api, base and currency see exchange.IO.
Futures_Bitget (Futures)
| Command | Arguments | Description | Returns |
|---|---|---|---|
simulate | bool | Switch between demo (true) and live (false) trading; demo requests carry the paptrading header, the API address stays the same. Demo pairs use coin names with an S prefix. | Null also on success. |
cross | bool[, symbol] | Cross (true, crossed) / isolated (false) margin; sends a switch request to the exchange. A unified account (v3) cannot switch and is always cross margin; the call fails. | Null also on success; check GetLastError() afterwards when needed. |
dual | bool[, symbol] | Hedge (true, hedge_mode) / one-way (false, one_way_mode) position mode; sends a switch request to the exchange. Set per product type (USDT, USDC, coin-margined) on a classic account (v2), account-wide on a unified account (v3). | true on success. |
For the common commands api, base and currency see exchange.IO.
Function Support
All exchange objects
No unsupported standard functions.
Bitget (Spot)
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 3m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 3d, 1w, 1M; other periods are synthesized by the docker. 3m is available only with the unified account (v3).
Futures_Bitget (Futures)
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 3m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d, 3d, 1w, 1M; other periods are synthesized by the docker. Coin-margined delivery contracts on a unified account (v3) have no 3d period.
Margin, Account and Simulation
All exchange objects
Account: The "Version" option selects the account type: v3 for a unified account (private API under /api/v3), v2 for a classic account (under /api/v2). A unified account calling the classic API is rejected by the exchange (40085); choose the version matching the account.
Bitget (Spot)
Simulation: Check the Simulate box when adding the exchange to use Bitget demo trading; it needs a demo API key. exchange.IO("simulate", true) still switches at run time for older strategies.
Futures_Bitget (Futures)
Margin mode: On a classic account (v2) switch cross/isolated margin per contract with exchange.IO("cross", bool); a unified account (v3) is always cross margin. Set leverage with exchange.SetMarginLevel(); under isolated margin only the side given by exchange.SetDirection() is set (buy long, sell short, long when no direction was set), or pass holdSide (v2) or posSide (v3) in the extra parameters.
Position mode: Orders carry open/close parameters matching the account's actual position mode; switch it with exchange.IO("dual", bool).
Simulation: Check the Simulate box when adding the exchange (or switch at run time with exchange.IO("simulate", true) for older strategies) to use Bitget demo trading; it needs a demo API key, and pairs are written as SBTC_SUSDT etc. The unified account (v3) API does not support demo instruments; choose v2 for demo trading.
Notes
Bitget (Spot)
- A unified account (v3) has no spot conditional-order API, so conditional-order functions (
exchange.CreateConditionOrder(),exchange.GetConditionOrders(), etc.) report an error and return null; a classic account (v2) supports take-profit and stop-loss conditional orders (not OCO) andexchange.ModifyConditionOrder(). exchange.ModifyOrder()amends in place on a unified account; on a classic account it uses the cancel-replace endpoint (cancel-replace-order) and returns the new order's ID (expressed by its client order ID, in the formclientOid:…), which works directly for cancelling and querying the order.
Futures_Bitget (Futures)
exchange.GetFundings()has no batch query; pass a specific perpetual contract, for exampleexchange.GetFundings("ETH_USDT.swap").- Conditional orders support take-profit and stop-loss only, not OCO; create a take-profit order and a stop-loss order separately when needed.
- On a classic account (v2),
exchange.ModifyOrder()has the exchange cancel the old order and place a new one, so the order ID changes and the new ID is returned (a client order ID of the formclientOid:..., usable for queries and cancellation as usual); a unified account (v3) amends in place. - Order quantity units: on a classic account (v2) every contract family is in base coin (1 contract = 1 coin); on a unified account (v3) USDT and USDC contracts are in base coin and coin-margined contracts in USD contracts. See
CtValandCtValCcyinexchange.GetMarkets(). - On a unified account (v3), coin-margined contracts support neither conditional orders nor
exchange.ModifyOrder(); calls report an error. - Without
since,exchange.GetHistoryConditionOrders()covers the last 7 days on a classic account (v2) and the last 30 days on a unified account (v3); withsinceit covers the 30 days starting atsince.