去年 9 月,我第一次尝试用 Python 拉 Bybit 的逐笔成交数据做合约回测,原本以为半小时就能搞定的事,结果熬到凌晨三点还卡在一个莫名其妙的报错上。屏幕上反复弹出的红色警告像在嘲笑我:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.bybit.com', port=443):
Max retries exceeded with url: /v5/market/kline
Caused by ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f...>,
'Connection to api.bybit.com timed out after 30000ms')
如果你在国内做量化