api = TqApi(backtest=TqBacktest(start_dt=date(2020,2,27), end_dt=date(2020,2,28))) klines = api.get_kline_serial("KQ.m@SHFE.rb", 60) while True: api.wait_update() if api.is_changing(klines): print('{} / - {}'.format(time_to_str(klines.iloc[-1]['datetime']), klines.iloc[-1]['volume']))