Trailing stops: trailing_stop_pct on enter_long/enter_short; advance_trailing_stop ratchets the stop with price and never loosens. Shared by engine + backtester. Position gains trailing_stop_pct (additive migration). momentum exposes it.
Parameter sweeps: POST /api/sweep runs a cartesian grid through the backtester, ranked by return − max drawdown. New dashboard Parameter sweep panel.
Testing
Backend: 93 tests pass, ruff clean.
Frontend: build + tests pass.
Smoke-tested vs live BTC/USDT 5m: sweep ranked 6 combos; momentum with a trailing stop exited via the trail.
## Summary
- **Trailing stops**: `trailing_stop_pct` on `enter_long`/`enter_short`; `advance_trailing_stop` ratchets the stop with price and never loosens. Shared by engine + backtester. `Position` gains `trailing_stop_pct` (additive migration). `momentum` exposes it.
- **Parameter sweeps**: `POST /api/sweep` runs a cartesian grid through the backtester, ranked by return − max drawdown. New dashboard **Parameter sweep** panel.
## Testing
- Backend: 93 tests pass, ruff clean.
- Frontend: build + tests pass.
- Smoke-tested vs live BTC/USDT 5m: sweep ranked 6 combos; momentum with a trailing stop exited via the trail.
Trailing stops: strategies can pass trailing_stop_pct to enter_long/enter_short.
advance_trailing_stop in app/engine/portfolio.py ratchets the stop with the price
(up for longs, down for shorts) and never loosens; the engine persists the
ratcheted level and the backtester applies the same logic. Position gains a
trailing_stop_pct column (additive migration). momentum exposes it as a param.
Parameter sweeps: app/backtest/sweep.py runs a cartesian grid through the same
backtester and ranks by return minus max drawdown. POST /api/sweep plus a
dashboard Parameter sweep panel.
matitos
merged commit 6df44520fa into main2026-09-20 01:18:54 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
trailing_stop_pctonenter_long/enter_short;advance_trailing_stopratchets the stop with price and never loosens. Shared by engine + backtester.Positiongainstrailing_stop_pct(additive migration).momentumexposes it.POST /api/sweepruns a cartesian grid through the backtester, ranked by return − max drawdown. New dashboard Parameter sweep panel.Testing