Skip to content

Commit

Permalink
fixbug akshare_backend.py index support
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-wang authored and mapicccy committed Jun 4, 2024
1 parent 1aa1811 commit 2639f86
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions funcat/data/akshare_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def get_price(self, order_book_id, start, end, freq):
try:
if is_index:
code = order_book_id[7:].lower() + order_book_id[:6]
df = self.ak.stock_zh_index_daily_em(code)
df['trade_date'] = df['date'].apply(lambda x: x.strftime("%Y%m%d"))
df = df.loc[df["trade_date"] >= str_start_date & df["trade_date"] <= str_end_date]
df = self.ak.stock_zh_index_daily_em(code,start_date=start, end_date=end)
elif is_fund:
code = self.convert_code(order_book_id)
df = self.ak.fund_etf_hist_em(code,start_date=start, end_date=end, adjust="qfq")
Expand Down

0 comments on commit 2639f86

Please sign in to comment.