From 3bfb7f0261151a2e84c48cf743e9ec75789f5805 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Dec 2018 10:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9get=5Ftoday=5Fticks=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?tick=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=81=BF=E5=85=8D=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E8=B0=83=E7=94=A8=E8=8E=B7=E5=8F=96=E5=85=A8=E9=83=A8?= =?UTF-8?q?tick=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=8F=90=E9=AB=98=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E9=80=9F=E5=BA=A6=E3=80=82=E5=BC=95=E5=85=A5=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=8F=82=E6=95=B0=EF=BC=8C=E4=B8=8D=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E5=8E=9F=E6=9C=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tushare/stock/trading.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tushare/stock/trading.py b/tushare/stock/trading.py index 0425c004..2867012e 100644 --- a/tushare/stock/trading.py +++ b/tushare/stock/trading.py @@ -229,7 +229,7 @@ def get_sina_dd(code=None, date=None, vol=400, retry_count=3, pause=0.001): raise IOError(ct.NETWORK_URL_ERROR_MSG) -def get_today_ticks(code=None, retry_count=3, pause=0.001): +def get_today_ticks(code=None, retry_count=3, pause=0.001, all=True): """ 获取当日分笔明细数据 Parameters @@ -263,9 +263,10 @@ def get_today_ticks(code=None, retry_count=3, pause=0.001): data_str = json.dumps(data_str) data_str = json.loads(data_str) pages = len(data_str['detailPages']) + fixed_pages = 1 if all == False else pages data = pd.DataFrame() ct._write_head() - for pNo in range(1, pages+1): + for pNo in range(1, fixed_pages+1): data = data.append(_today_ticks(symbol, date, pNo, retry_count, pause), ignore_index=True) except Exception as er: