2.49K 浏览
0

测试中用get_kline_serial(symbol, 60)返回的1分钟K线数据与文华、博易的有差别,主要是收盘价和交易量经常不一致。文华与博易的数据是一致的,那么是信易的数据不对么?

BTW:我用信易的模拟帐号登录的,难道是模拟行情的数据与实盘数据不一致?

kline = self.api.get_kline_serial(symbol, 60)
async with self.api.register_update_notify(kline) as update_chan:
    async for _ in update_chan:
        if self.api.is_changing(kline.iloc[-1], 'datetime'):
            latest = kline.iloc[-2]   # 新K线已经生成,上一K线已固定,计入
            _time = tafunc.time_to_datetime(latest['datetime'])
            _time = datetime.strftime(_time, "%Y/%m/%d %H:%M:%S")
            output = f"{_time},{latest['id']},{latest['open']},{latest['high']},"\
                     f"{latest['low']},{latest['close']},{latest['volume']},"\
                     f"{latest['open_oi']},{latest['close_oi']}\n"
            print(output)

winfirm 已回答的问题 2021年5月18日
0

因为kline的合成方式不一致,kline并没有约定俗成的合成方式,我们的kline合成方式参考

https://www.shinnytech.com/blog/why-our-kline-different/

ringo 已回答的问题 2021年5月14日
您正在查看2个答案中的1个,单击此处查看所有答案。