shinnytech / tqsdk-python

天勤量化开发包, 期货量化, 实时行情/历史数据/实盘交易
https://doc.shinnytech.com/tqsdk/latest
Apache License 2.0
3.64k stars 650 forks source link

tqsdk.tools DataDownloader #173

Closed kzhui125 closed 5 years ago

kzhui125 commented 5 years ago

下载的数据:时间09:00:00.000000000有9个0

然而tafunc.time_to_s_timestamp和tafunc.time_to_str都是6个0

有点不一致啊

kzhui125 commented 5 years ago
def time_to_s_timestamp(t):
    return 1e9 * tafunc.time_to_s_timestamp(t[:-3])

klines = pd.read_csv('rb_1M.csv')
klines['datetime'] = klines['datetime'].apply(time_to_s_timestamp)

不过封装下就好了