From 1a01937e6cb873bd9b620274fef8c718238a63ae Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 29 Jan 2018 15:25:46 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BF=AE=E5=A4=8DQuantosDataService?= =?UTF-8?q?=E5=A4=9C=E7=9B=98=E6=95=B0=E6=8D=AE=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=BA=E8=B4=9F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/QuantosDataService/dataService.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/QuantosDataService/dataService.py b/examples/QuantosDataService/dataService.py index 4246f6d8..2571f871 100644 --- a/examples/QuantosDataService/dataService.py +++ b/examples/QuantosDataService/dataService.py @@ -66,7 +66,12 @@ def generateVtBar(row): sec=bar.time[4:6] if minute=="00": minute="59" - hour=str(int(hour)-1).rjust(2,'0') + + h = int(hour) + if h == 0: + h = 24 + + hour=str(h-1).rjust(2,'0') else: minute=str(int(minute)-1).rjust(2,'0') bar.time=hour+minute+sec