pyted / okx

Python OKX API interface
143 stars 44 forks source link

示例代码跑了一下, 出错了 #6

Closed ydqsbfsyi closed 7 months ago

ydqsbfsyi commented 7 months ago

okx/examples/4.1 APP K线服务 下载历史K线.ipynb

把示例代码跑了一下, 所有的下载都出现这样的错误: 2024-02-28 08:08:05,807 [ERROR] [get_history_candle_by_date] code=CANDLE_END_ERROR instId=BSV-USD-SWAP date=2024-02-28 bar=1m msg=BSV-USD-SWAP[valid candle end error]: correct_ts=1709135940000 error_ts=1709125620000.0 2024-02-28 08:08:11,898 [ERROR] [get_history_candle_by_date] code=CANDLE_END_ERROR instId=CRV-USD-SWAP date=2024-02-28 bar=1m msg=CRV-USD-SWAP[valid candle end error]: correct_ts=1709135940000 error_ts=1709125620000.0

是bug还是什么原因?

pyted commented 7 months ago

image

pyted commented 7 months ago

我测试了一下,okx代码是没有任何问题的,我之前也出过同类的错误,原因一般在于Pandas的版本,您可以这样做:

pip3 install candlelite --upgrade pip3 install paux --upgrade pip3 install pandas --upgrade pip3 install numpy --upgrade

1.5版本的Pandas在数据类型转换上有bug,可能造成数据验证的错误,而2.0以上的的Pandas则修正了这个错误。