mirror of
https://github.com/xavierchuan/FX-ML-Trading-Engine.git
synced 2026-08-18 19:38:06 +00:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import os, time, glob
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
base = "data/outputs"
|
||||
days_to_keep = 3
|
||||
cutoff = time.time() - days_to_keep * 86400
|
||||
|
||||
def clean_dir(path, exts):
|
||||
for ext in exts:
|
||||
for f in glob.glob(os.path.join(path, f"*.{ext}")):
|
||||
if os.path.getmtime(f) < cutoff:
|
||||
os.remove(f)
|
||||
print(f"🧹 Deleted old {ext}: {f}")
|
||||
|
||||
clean_dir(os.path.join(base, "equity"), ["csv"])
|
||||
clean_dir(os.path.join(base, "trades"), ["csv"])
|
||||
print("✅ Cleanup complete.")
|
||||
Reference in New Issue
Block a user