From 9956f421b06a33865432ae644e8d8ff3036358d7 Mon Sep 17 00:00:00 2001 From: drjones Date: Fri, 27 Feb 2026 13:41:50 -0800 Subject: [PATCH] Add minute-level trade scheduler and enable chaos-mode profile support --- .env.example | 1 + bot.py | 5 ++++- config.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 6975ea2..b118f68 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,7 @@ MIN_CONFIDENCE=0.62 FEE_PER_TRADE_USD=0.00 SLIPPAGE_BPS=5 TRADE_INTERVAL_HOURS=2 +TRADE_INTERVAL_MINUTES=0 CURATE_INTERVAL_MINUTES=30 TIMEZONE=America/Los_Angeles FORCE_PAPER_TRADES=true diff --git a/bot.py b/bot.py index 3d2d0ea..241d5ea 100644 --- a/bot.py +++ b/bot.py @@ -150,5 +150,8 @@ def run_cycle(): def start_scheduler(): scheduler.add_job(curate_cycle, "interval", minutes=settings.curate_interval_minutes, id="curate_cycle", replace_existing=True) - scheduler.add_job(run_cycle, "interval", hours=settings.trade_interval_hours, id="trade_cycle", replace_existing=True) + if settings.trade_interval_minutes and settings.trade_interval_minutes > 0: + scheduler.add_job(run_cycle, "interval", minutes=settings.trade_interval_minutes, id="trade_cycle", replace_existing=True) + else: + scheduler.add_job(run_cycle, "interval", hours=settings.trade_interval_hours, id="trade_cycle", replace_existing=True) scheduler.start() diff --git a/config.py b/config.py index 54b6dfb..9df50c9 100644 --- a/config.py +++ b/config.py @@ -18,6 +18,7 @@ class Settings: slippage_bps = float(os.getenv("SLIPPAGE_BPS", "5")) trade_interval_hours = int(os.getenv("TRADE_INTERVAL_HOURS", "2")) + trade_interval_minutes = int(os.getenv("TRADE_INTERVAL_MINUTES", "0")) curate_interval_minutes = int(os.getenv("CURATE_INTERVAL_MINUTES", "30")) timezone = os.getenv("TIMEZONE", "America/Los_Angeles") force_paper_trades = os.getenv("FORCE_PAPER_TRADES", "true").lower() == "true"