Fix ISO8601 timestamp parsing in indicator logging

This commit is contained in:
justin committed 2026-02-05 11:04:33 -07:00
1 parent f9815012e9
commit 23c6c5dafd
1 file changed
+1 -1
+1 -1
View File
@@ -539,7 +539,7 @@ def log_indicators(timestamp, symbol, price, volume, rsi_val, adx_val, atr_val,
existing = pd.read_csv(INDICATORS_PATH)
df = pd.concat([existing, df], ignore_index=True)
cutoff_date = datetime.now(EASTERN) - timedelta(days=7)
df['timestamp'] = pd.to_datetime(df['timestamp'])
df['timestamp'] = pd.to_datetime(df['timestamp'], format='ISO8601')
df = df[df['timestamp'] > cutoff_date]
df.to_csv(INDICATORS_PATH, index=False)