Files
kis_trader/scratch/disable_whipsaw.py

21 lines
525 B
Python

from database import TradeDB
db = TradeDB()
try:
snap = db.get_merged_env_snapshot()
updated = False
for prefix in ["MOMENTUM", "BREAKOUT", "SCALP", "SHORT"]:
key = f"{prefix}_WHIPSAW_FILTER_ENABLED"
if snap.get(key) != "false":
snap[key] = "false"
updated = True
print(f"Disabled {key}")
if updated:
db.insert_env_snapshot(snap)
print("Inserted new env snapshot.")
else:
print("Already disabled.")
finally:
db.close()