Closed Jastyle closed 4 years ago
请提供具体的代码
configuration.host = "https://fx-api-testnet.gateio.ws/api/v4" GateSwapApi = gate_api.FuturesApi(gate_api.ApiClient(configuration)) CONTRACT = 'BTC_USD' BTC_SETTLE = 'btc' USDT_SETTLE = 'usdt'
if name == 'main': position = GateSwapApi.get_position(settle=USDT_SETTLE, contract=CONTRACT) print(position)
你应该是把 contract 的名字写错了,可以通过 list_futures_contracts
查询到所有支持的列表
supported = [x.name for x in GateSwapApi.list_futures_contracts(settle=USDT_SETTLE)]
 ̄□ ̄||,谢谢!
请问u本位合约的api测试地址有么,我用https://fx-api-testnet.gateio.ws/api/v4这个测试地址获取仓位,报{"label":"CONTRACT_NOT_FOUND"}错误,币本位正常。