From ffb7d7f9106aa8779ce6c8a4407a8c29bb293795 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Wed, 19 Aug 2020 11:46:07 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=A2=9E=E5=BC=BA=E5=8A=9F=E8=83=BD]=20?= =?UTF-8?q?=E5=A4=A9=E5=8B=A4=E4=BD=BF=E7=94=A8=E5=BF=AB=E6=9C=9F=E7=9A=84?= =?UTF-8?q?=E5=85=8D=E8=B4=B9=E8=A1=8C=E6=83=85=E6=95=B0=E6=8D=AE=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prod/jobs/refill_tq_future_ticks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/prod/jobs/refill_tq_future_ticks.py b/prod/jobs/refill_tq_future_ticks.py index be27cc5d..559b9bf9 100644 --- a/prod/jobs/refill_tq_future_ticks.py +++ b/prod/jobs/refill_tq_future_ticks.py @@ -37,8 +37,8 @@ if __name__ == "__main__": print('下载合约未设定 参数 -s rb2010') os._exit(0) - # 开始下载 - api = TqApi(TqSim()) + # 开始下载(使用快期的免费行情websocket) + api = TqApi(account=TqSim(), url="wss://u.shinnytech.com/t/md/front/mobile") download_tasks = {} begin_date = datetime.strptime(args.begin, '%Y%m%d') end_date = datetime.strptime(args.end, '%Y%m%d') @@ -58,7 +58,7 @@ if __name__ == "__main__": if n_days <= 0: n_days = 1 - for n in range(n_days+1): + for n in range(n_days + 1): download_date = begin_date + timedelta(days=n) if download_date.isoweekday() in [6, 7]: continue @@ -70,9 +70,9 @@ if __name__ == "__main__": os.makedirs(save_folder) save_file = os.path.abspath(os.path.join(save_folder, - "{}_{}.csv".format(symbol, download_date.strftime('%Y%m%d')))) + "{}_{}.csv".format(symbol, download_date.strftime('%Y%m%d')))) zip_file = os.path.abspath(os.path.join(save_folder, - "{}_{}.pkb2".format(symbol, download_date.strftime('%Y%m%d')))) + "{}_{}.pkb2".format(symbol, download_date.strftime('%Y%m%d')))) if os.path.exists(save_file): # 文件size是否大于1024字节