okx icon indicating copy to clipboard operation
okx copied to clipboard

Python OKX API interface

Results 20 okx issues
Sort by recently updated
recently updated
newest added

正常用了几年了,今天突然出现调用任何接口都引发“KeyError('code')”的异常 如account.get_balance()和public.get_instruments(instType="SWAP")

okex.com Offline

刚刚还有数据的,现在返回空列表,是不是被禁了。

``` okx_swap = OkxSWAP(OKX_API_KEY, OKX_API_SECRET, OKX_API_PASSPHRASE, OKX_IS_DEMO) trade = okx_swap.trade swap_market = okx_swap.market history_candle_latest = swap_market.get_history_candle_latest( instId='BTC-USDT-SWAP', length=200, bar='1m' ) eprint(history_candle_latest) ``` 这个输出有报错: {'code': 'CANDLE_LENGTH_ERROR', 'data': array([[-2.14748365e+09, 1.09488500e+05, 1.09506800e+05, 1.09457300e+05,...

urllib3==1.26.12 你好,可以不固定urllib3版本吗,和其他库冲突了

问题如下,它计算出的 sz 为0, 和实际不符,疑似是向上取整和合约张数最小单位的锅。 Input: `get_quantity_result = a.trade.get_quantity( openPrice=0.234, openMoney=10, instId='DOGE-USDT-SWAP', ordType='limit', leverage=20, ) print(get_quantity_result)` OutPut: '{'code': '0', 'data': 0, 'msg': ''}' 相关代码应该位于 okx/app/trade/tradeSWAP/quantity_and_price.py/get_quantity()

https://www.okx.com/docs-v5/en/#funding-account-rest-api-withdrawal