From f5d2345ee1f5bdda523bf794b07cacb239bc584f Mon Sep 17 00:00:00 2001 From: Edanflame <237397488@qq.com> Date: Tue, 9 Nov 2021 17:37:31 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy_tushare/tushare_datafeed.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/vnpy_tushare/tushare_datafeed.py b/vnpy_tushare/tushare_datafeed.py index 5ebb5fc..f1749a6 100644 --- a/vnpy_tushare/tushare_datafeed.py +++ b/vnpy_tushare/tushare_datafeed.py @@ -167,13 +167,28 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]: # 其他 else: - df = ts.pro_bar( + d1 = ts.pro_bar( ts_code=ts_symbol, start_date=start, end_date=end, asset=asset, freq=ts_interval ) + df = deepcopy(d1) + + while True: + if len(d1) != 8000: + break + tmp_end = d1["trade_time"].values[-1] + + d1 = ts.pro_bar( + ts_code=ts_symbol, + start_date=start, + end_date=tmp_end, + asset=asset, + freq=ts_interval + ) + df = pd.concat([df[:-1], d1]) data: List[BarData] = []