1YOUExit when momentum turns negative instead of the 5% stop.
2AIDone — should_exit in signals.py now checks momentum. Backtest 2022 → 2026: Sharpe 1.62 → 1.71. That’s on the months the change was made on, so it proves nothing yet: it counts once a new walk-forward confirms it on months it hasn’t seen.
YOUGood. Walk-forward it before we go live.
AIWF #4 declared: 12 folds, IS 12m / OOS 3m. The code is frozen for the whole plan.
4signals.py · your logicstrategy.py · orders & data
# signals.py — pure Python, no EdgeFound imports
def momentum(closes: list[float], lookback: int) -> float:
return closes[-1] / closes[-lookback] - 1
def should_enter(closes, lookback, threshold) -> bool:
return momentum(closes, lookback) > threshold
−def should_exit(entry, price, stop) -> bool:
− return price / entry - 1 <= -stop
+def should_exit(closes, lookback) -> bool:
+ return momentum(closes, lookback) < 0