From 6a6a3408dd4c4979e69e968ee6fab939992f9afe Mon Sep 17 00:00:00 2001 From: msincenselee Date: Wed, 8 Jan 2020 16:03:23 +0800 Subject: [PATCH] =?UTF-8?q?[bug=20fix]=20=E4=BF=AE=E5=A4=8D=E5=8F=96?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E6=95=B0=E6=8D=AE=E5=BE=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/data/tdx/refill_tdx_future_bars.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vnpy/data/tdx/refill_tdx_future_bars.py b/vnpy/data/tdx/refill_tdx_future_bars.py index a70c37f9..1ea2d4b5 100644 --- a/vnpy/data/tdx/refill_tdx_future_bars.py +++ b/vnpy/data/tdx/refill_tdx_future_bars.py @@ -20,7 +20,7 @@ from vnpy.data.tdx.tdx_future_data import * bar_data_folder = os.path.abspath(os.path.join(vnpy_root, 'bar_data')) # 开始日期(每年大概需要几分钟) -start_date = '20160101' +start_date = '20190101' # 创建API对象 api_01 = TdxFutureData() @@ -55,6 +55,8 @@ for underlying_symbol in api_01.future_contracts.keys(): start_dt=start_dt, return_bar=False) # [dict] => dataframe + if not result or len(bars) == 0: + continue df_extern = pd.DataFrame(bars) df_extern.set_index('datetime', inplace=True) @@ -74,4 +76,4 @@ for underlying_symbol in api_01.future_contracts.keys(): print(data_df.tail()) data_df.to_csv(bar_file_path, index=True) print(f'更新{index_symbol}数据 => 文件{bar_file_path}') - + break