Skip to content

Commit

Permalink
Merge pull request #4 from Edanflame/main
Browse files Browse the repository at this point in the history
[Fix] 修改数据下载限制
  • Loading branch information
vnpy authored Nov 10, 2021
2 parents cab747f + f5d2345 commit 26015d4
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 26015d4

Please sign in to comment.