Skip to content

Commit

Permalink
[Fix] 修改数据下载限制
Browse files Browse the repository at this point in the history
  • Loading branch information
Edanflame committed Nov 9, 2021
1 parent cab747f commit f5d2345
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion vnpy_tushare/tushare_datafeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = []

Expand Down

0 comments on commit f5d2345

Please sign in to comment.