設置現貨對衝
您可以開關現貨對從功能, 僅限統一帳戶組合保證金模式下
HTTP 請求
POST /v5/account/set-hedging-mode
請求參數
參數 | 是否必需 | 類型 | 說明 |
---|---|---|---|
setHedgingMode | true | string | ON , OFF |
響應參數
參數 | 類型 | 說明 |
---|---|---|
retCode | integer | Result code |
retMsg | string | Result message |
請求示例
- HTTP
- Python
- Node.js
POST /v5/account/set-hedging-mode HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXXX
X-BAPI-API-KEY: XXXXXX
X-BAPI-TIMESTAMP: 1700117968580
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json
Content-Length: 31
{
"setHedgingMode": "OFF"
}
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.setSpotHedging({
setHedgingMode: 'ON' | 'OFF',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
響應示例
{
"retCode": 0,
"retMsg": "SUCCESS"
}