Add force paper trading mode to ensure activity during testing

This commit is contained in:
2026-02-26 18:00:55 -08:00
parent dbf6bf4e73
commit 1da0c04242
3 changed files with 8 additions and 1 deletions

7
bot.py
View File

@@ -43,7 +43,7 @@ def curate_cycle():
def run_cycle():
db = SessionLocal()
try:
if not market_open():
if not market_open() and not (settings.paper_mode and settings.force_paper_trades):
return
spent = _daily_spent(db)
if spent >= settings.max_daily_notional:
@@ -82,6 +82,11 @@ def run_cycle():
db.commit()
db.refresh(drow)
if settings.paper_mode and settings.force_paper_trades and decision["action"] == "hold":
decision["action"] = "buy"
decision["confidence"] = max(decision.get("confidence", 0.0), settings.min_confidence)
decision["reason"] = f"{decision.get('reason','')} | force_paper_trades"
should_trade = decision["action"] in {"buy", "sell"} and decision["confidence"] >= settings.min_confidence
if should_trade: