跳至主要内容

查詢網格機器人詳情

查詢指定合約網格機器人的完整詳情,包括配置、狀態、盈虧指標、倉位信息、保證金餘額及時間戳。

信息
  • bot_id
    創建合約網格機器人響應或機器人列表端點中獲取。

  • 盈虧字段:
    pnl 為累計總盈虧。grid_profit 僅涵蓋網格交易利潤。realised_pnlunrealised_pnl 進一步細分總盈虧。

  • 頻率限制:
    每個 UID 每秒最多 10 次請求。

HTTP請求

POST/v5/fgridbot/detail

請求參數

參數是否必需類型說明
bot_idtruestring要查詢的機器人 ID

響應參數

參數類型說明
status_codeinteger0 = 成功,非零 = 錯誤
debug_msgstring調試信息(僅測試網)
detailobject網格機器人詳情對象(詳見下方)
> bot_idstring唯一網格機器人 ID
> symbolstring交易對名稱(例如 BTCUSDT
> base_tokenstring基礎幣種(例如 BTC
> quote_tokenstring報價幣種(例如 USDT
> statusstring機器人生命週期狀態:UnspecifiedRejectedNewInitializingRunningCancellingCompletedAwait activation
> grid_modestring策略方向:UnspecifiedNeutralLongShort
> grid_typestring網格間距類型:UnspecifiedArithmeticGeometric
> min_pricestring網格價格下限(小數字符串)
> max_pricestring網格價格上限(小數字符串)
> cell_numberinteger網格層數
> leveragestring初始槓桿倍數(例如 "5" 表示 5 倍)
> real_leveragestring實際有效槓桿(例如 "4.8" 表示 4.8 倍)
> total_investmentstring總投資金額,含追加投入(小數字符串)
> total_valuestring總倉位價值,以報價幣種計(小數字符串)
> current_positionstring當前持倉合約數量(小數字符串)
> pnlstring累計總盈虧,以報價幣種計(小數字符串)
> pnl_perstring盈虧佔總投資的百分比(例如 "0.0505" 表示 5.05%)
> grid_profitstring僅網格交易利潤(小數字符串)
> grid_aprstring網格利潤年化收益率百分比(例如 "0.365" 表示 36.5% APR)
> total_aprstring總年化收益率百分比(例如 "0.42" 表示 42% APR)
> realised_pnlstring累計已實現盈虧(小數字符串)
> unrealised_pnlstring基於標記價格的未實現盈虧(小數字符串)
> funding_feestring累計資金費(小數字符串,正值 = 收入,負值 = 支出)
> position_balancestring倉位保證金餘額(小數字符串)
> available_balancestring可用(空閒)保證金餘額(小數字符串)
> total_order_balancestring掛單鎖定保證金(小數字符串)
> equitystring當前淨值(小數字符串)
> last_pricestring當前最新成交價格
> mark_pricestring當前標記價格
> liquidation_pricestring預估強平價格
> stop_loss_perstring止損百分比(例如 "0.1" 表示 10%)
> take_profit_perstring止盈百分比(例如 "0.2" 表示 20%)
> stop_loss_pricestring止損價格
> take_profit_pricestring止盈價格
> tp_sl_typestring止盈止損觸發模式:UnspecifiedBoth %Both priceTP price+SL %TP %+SL price
> entry_pricestring入場觸發價格
> real_close_pricestring機器人停止時的實際價格
> min_price_precisionstring該交易對的最小價格精度
> tick_sizestring最小價格增量
> trailing_stop_perstring移動止損回撥百分比(例如 "0.05" 表示 5%)
> trailing_stop_exit_equitystring移動止損退出時的淨值(小數字符串)
> close_reasonstringUnspecifiedInit failureUser stoppedTake-profit triggeredInsufficient order balanceLiquidationContract delistedFBU trigger failedAsset transfer failedStop-loss triggeredReduce-onlyRisk limitSystem anomaly — fallback stopClose price worse than bankruptcy priceUser bannedNeutral grid hit top priceNeutral grid hit bottom priceCopyTrade master stoppedCopyTrade follower insufficient balanceCopyTrade bad entry timingNegative arbitrageTrailing stopCompliance clearanceADL (Auto-Deleveraging)
> bot_close_codestringUnspecifiedFailed initiationCanceled manually by userCanceled automatically (other)Canceled by take-profit triggerCanceled by stop-loss triggerCanceled by liquidationDCA reached max investmentUser account bannedNeutral grid hit top priceNeutral grid hit bottom priceMartingale round take-profit triggeredSymbol delistedNegative arbitrageTrailing stop exitCompliance clearanceADL (Auto-Deleveraging)
> futures_pos_sidestringUnspecifiedShort positionLong position
> arbitrage_numinteger總套利(網格成交)次數
> arbitrage_num_24integer過去 24 小時套利次數
> min_profitstring最低每格利潤率百分比
> max_profitstring最高每格利潤率百分比
> move_up_pricestring網格移動的最高上限價格
> move_down_pricestring網格移動的最低下限價格
> curr_min_pricestring當前有效網格最低價格
> curr_max_pricestring當前有效網格最高價格
> i_m_ratestring初始保證金率(小數比例,例如 "0.1" = 10%)
> m_m_ratestring維持保證金率(小數比例,例如 "0.005" = 0.5%)
> account_typestringUnspecifiedDerivative accountUnified margin accountAccount upgradingSpot accountUTA (Unified Trading Account)Fund account
> allow_followinteger是否允許跟單:1 是,0
> follow_numinteger跟單此機器人的用戶數量
> copy_trade_is_masterboolean此機器人是否為跟單主策略
> copy_trade_follower_numstring跟單跟隨者數量
> used_reward_amountstring已使用的憑證/獎勵總金額
> used_reward_idstring首個使用的保險憑證 ID
> init_bonusstring初始獎勵金額
> used_bonus_amountstring已消耗的獎勵金額
> settlement_assetsstring結算資產信息
> cum_withdrew_amountstring累計提取保證金金額
> current_profitstring當前運行盈虧(小數字符串)
> current_perstring當前運行盈虧百分比(例如 "0.032" 表示 3.2%)
> taker_fee_ratestring吃單手續費率(小數比例,例如 "0.0006" = 0.06%)
> maker_fee_ratestring掛單手續費率(小數比例,例如 "0.0001" = 0.01%)
> operation_timestring自機器人創建以來的毫秒數
> create_timestring機器人創建時間戳(Unix 毫秒)
> modify_timestring最後更新時間戳(Unix 毫秒)
> end_timestring機器人結束時間戳(Unix 毫秒),運行中返回 0
> adl_rank_indicatorintegerADL(自動減倉)排名指標

請求示例

POST /v5/fgridbot/detail HTTP/1.1
Host: api-testnet.bybit.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
X-BAPI-TIMESTAMP: 1672211928338
X-BAPI-RECV-WINDOW: 5000
Content-Type: application/json

{
"bot_id": "612330315406398322"
}

響應示例

{
"retCode": 0,
"retMsg": "success",
"result": {
"status_code": 0,
"detail": {
"bot_id": "612330315406398322",
"symbol": "BTCUSDT",
"status": "FUTURE_GRID_STATUS_COMPLETED",
"base_token": "BTC",
"quote_token": "USDT",
"min_price": "230000",
"max_price": "800000",
"cell_number": 88,
"grid_type": "FUTURE_GRID_TYPE_GEOMETRIC",
"grid_mode": "FUTURE_GRID_MODE_LONG",
"stop_loss_per": "",
"take_profit_per": "0.28",
"real_leverage": "6",
"total_investment": "950",
"total_value": "",
"current_position": "",
"arbitrage_num": 0,
"arbitrage_num_24": 0,
"pnl": "0",
"pnl_per": "0.0000",
"grid_profit": "0",
"grid_apr": "0",
"total_apr": "0",
"last_price": "",
"liquidation_price": "",
"realised_pnl": "",
"unrealised_pnl": "",
"funding_fee": "",
"position_balance": "",
"available_balance": "",
"total_order_balance": "",
"close_reason": "F_GRID_BOT_STOP_TYPE_TRIGGER_FBU_FAIL",
"allow_follow": 1,
"operation_time": "1110",
"create_time": "1774506909414",
"modify_time": "1774506910524",
"end_time": "1774506910522",
"min_profit": "8.1959",
"max_profit": "8.1959",
"leverage": "6",
"mark_price": "",
"bot_close_code": "BOT_CLOSE_CODE_FAILED_INITIATION",
"futures_pos_side": "FUTURES_POSITION_SIDE_UNSPECIFIED",
"follow_num": 0,
"entry_price": "370000",
"stop_loss_price": "200000",
"take_profit_price": "",
"tp_sl_type": "TP_SL_TYPE_TP_PERCENT_SL_PRICE",
"real_close_price": "",
"min_price_precision": "0.01",
"tick_size": "0.10",
"used_reward_amount": "",
"settlement_assets": "950 USDT",
"account_type": "BOT_ACCOUNT_TYPE_FUND",
"cum_withdrew_amount": "0",
"current_profit": "",
"current_per": "",
"copy_trade_is_master": false,
"copy_trade_follower_num": "0",
"init_bonus": "0",
"used_bonus_amount": "",
"used_reward_id": "",
"taker_fee_rate": "0.00028",
"maker_fee_rate": "0.0001",
"equity": "0",
"trailing_stop_exit_equity": "0",
"trailing_stop_per": "0.18",
"i_m_rate": "",
"m_m_rate": "",
"move_up_price": "",
"move_down_price": "",
"curr_min_price": "",
"curr_max_price": "",
"adl_rank_indicator": 0
},
"debug_msg": ""
},
"retExtInfo": {},
"time": 1774508203378
}