okx
okx copied to clipboard
Python OKX API interface
为什么BTC、eth合约下单张数限制为最少0.1张,0.1张太多了 风险大。
我试了一下: examples/4.3 APP K线服务 维护实时历史K线.ipynb 改了一下时区, 尝试下载两个品种的k线, 然后开盘时间不对啊, 4H开盘时间怎么能是23:00 时间相关的代码: ``` from okx.app.candle_server import CandleRule,CandleServer class MyCandleRule(CandleRule): TIMEZONE = 'Asia/Shanghai' ....... ``` ``` import datetime def stmptotime(stmp): temp = int(stmp)/1000.0...
怎么获取秒级k线
隔壁可以用 https://api.binance.com/api/v3/klines?interval=1s&symbol=BTCUSDT
version okx 2.1.1 ` account = Account( key=key, secret=secret, passphrase=passphrase, flag=flag, proxies=proxies, proxy_host=proxy_host, ) config_result = account.get_config() ` 使用香港服务器直接请求会出现下面问题: okx.api._client.ResponseStatusError: Error response_status_code 401 response_content={"msg":"APIKey does not match current environment.","code":"50101"}
` history_candle = self.market.get_history_candle( instId='BTC-USDT', start='2024-01-01 00:00:00', end='2024-01-01 23:59:00', bar='2H', ) eprint(history_candle) print('candle.shape=', history_candle['data'].shape)` 返回的是 ` {'code': 'CANDLE_START_ERROR', 'data': array([], shape=(0, 9), dtype=float64), 'msg': 'BTC-USDT[candle empty]'} candle.shape= (0, 9)`
如何添加代理?
调用老师您的库,怎么配置代理,okex国内访问不了
初学,看了几个教程,先开始尝试写一小段实验代码: ```python from okx.app import OkxSWAP from okx.app import MarketSWAP from okx.app import Market import websocket import json import pandas as pd import datetime # 对于下述代码 okxSWAP.market 等同于 marketSWAP 等同于...
没有返回数据
 老师,麻烦您看看图上的问题,等了很久,都没有返回数据
50101 | 401 | APIKey 与当前环境不匹配 50102 | 401 | 请求时间戳过期 50103 | 401 | 请求头"OK-ACCESS-KEY"不能为空 50104 | 401 | 请求头"OK-ACCESS-PASSPHRASE"不能为空 50105 | 401 | 请求头"OK-ACCESS-PASSPHRASE"错误 50106 | 401 |...
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.okex.com', port=443): Max retries exceeded with url: /api/v5/public/instruments?instType=SWAP (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))