Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #99

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adata/fund/market/etf_market_ths.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def get_market_etf_ths(self, fund_code: str = '512880', k_type: int = 1, start_d
for d in data_list:
data.append(str(d).split(',')[0:7])
result_df = pd.DataFrame(data=data, columns=['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount'])
result_df = result_df[result_df['volume'] != '0']
result_df['fund_code'] = fund_code
result_df['trade_time'] = pd.to_datetime(result_df['trade_date']).dt.strftime('%Y-%m-%d %H:%M:%S')
result_df['trade_date'] = pd.to_datetime(result_df['trade_date'], format='%Y%m%d').dt.strftime('%Y-%m-%d')
Expand Down Expand Up @@ -94,6 +95,7 @@ def get_market_etf_min_ths(self, fund_code='512880'):
data.append(str(d).split(','))
# 3. 封装数据
result_df = pd.DataFrame(data=data, columns=['trade_time', 'price', 'amount', 'avg_price', 'volume'])
result_df = result_df[result_df['volume'] != '0']
result_df['fund_code'] = fund_code
result_df['trade_time'] = trade_date + result_df['trade_time']
result_df['trade_date'] = pd.to_datetime(trade_date, format='%Y%m%d').strftime('%Y-%m-%d')
Expand Down
Loading