fix mixed timezone comparison in log_indicators

This commit is contained in:
Justin Oros
2026-03-12 11:55:30 -07:00
parent a6ae001e69
commit 3a2a4ef6de
+2 -3
View File
@@ -621,8 +621,8 @@ def log_indicators(timestamp, symbol, price, volume, rsi_val, adx_val, atr_val,
if INDICATORS_PATH.exists():
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'], format='ISO8601')
df['timestamp'] = pd.to_datetime(df['timestamp'], utc=True)
cutoff_date = pd.Timestamp.now(tz='UTC') - timedelta(days=7)
df = df[df['timestamp'] > cutoff_date]
df.to_csv(INDICATORS_PATH, index=False)
@@ -2036,4 +2036,3 @@ def run():
if __name__ == "__main__":
main()