auto-sync: 2026-05-02 19:04:18

This commit is contained in:
cfdaily
2026-05-02 19:04:18 +08:00
parent 660b3749bc
commit 3fef9fddba
+2
View File
@@ -89,6 +89,8 @@ def fetch_tencent_daily(code: str, start_date: str, end_date: str):
else:
df = pd.DataFrame(klines, columns=['date', 'open', 'close', 'high', 'low', 'volume'])
df['amount'] = 0.0
for c in ['open', 'close', 'high', 'low', 'volume', 'amount']:
df[c] = pd.to_numeric(df[c], errors='coerce').fillna(0)
df['date'] = pd.to_datetime(df['date']).dt.strftime('%Y-%m-%d')
mask = (df['date'] >= start_date) & (df['date'] <= end_date)
result = df.loc[mask, ['date', 'open', 'high', 'low', 'close', 'volume', 'amount']]