Add trailing stops and parameter sweeps
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.
This commit is contained in:
1 parent
d80e7b155e
commit
9dc00eba95
22 files changed
+575
-7
No files matched your search
@@ -8,6 +8,7 @@ import OrdersTable from './components/OrdersTable.vue'
|
||||
import PositionsTable from './components/PositionsTable.vue'
|
||||
import StatusCards from './components/StatusCards.vue'
|
||||
import StrategyPanel from './components/StrategyPanel.vue'
|
||||
import SweepPanel from './components/SweepPanel.vue'
|
||||
|
||||
const status = ref({
|
||||
running: false,
|
||||
@@ -196,6 +197,7 @@ onUnmounted(() => {
|
||||
/>
|
||||
|
||||
<BacktestPanel :strategies="strategies" :status="status" />
|
||||
<SweepPanel :strategies="strategies" :status="status" />
|
||||
|
||||
<div class="grid gap-4 lg:grid-cols-2">
|
||||
<EquityChart :points="equityPoints" />
|
||||
|
||||
Reference in new issue
Block a user