diff --git a/POSITION_SCALING_ROADMAP.md b/POSITION_SCALING_ROADMAP.md index 11ddf26..b3c6c46 100644 --- a/POSITION_SCALING_ROADMAP.md +++ b/POSITION_SCALING_ROADMAP.md @@ -4,8 +4,11 @@ - **Total Trades:** 26 completed - **P&L:** +$27.12 (38% win rate) - **Shorts:** 6.6x more profitable than longs (+$2.46 vs -$0.37 avg) -- **Current Strategy:** 75% at TP1 (+1.5%), 25% at TP2 (+3%), no runner -- **Problem:** Missed +41% move (would've closed at +3%) +- **Current Strategy:** + - TP1 at +1.5%: Close 75% + - TP2 at +3.0%: Close 80% of remaining (20% total) + - **Runner: 5% of position with 0.3% trailing stop ✅ ALREADY IMPLEMENTED** +- **Problem:** Small runner size (5%) + tight trailing stop (0.3%) may be suboptimal - **Data Quality:** Ready to collect signal quality scores for correlation analysis --- @@ -184,38 +187,43 @@ ORDER BY count DESC; --- -## Phase 5: Runner with Trailing Stop ⏳ -**Prerequisites:** ✅ Phase 3 complete, ✅ Runner potential confirmed (MFE > TP2 in 30%+ of trades) +## Phase 5: Optimize Runner Size & Trailing Stop ⏳ +**Prerequisites:** ✅ Phase 3 complete, ✅ Runner data collected (10+ trades with runners) + +**Current Implementation:** ✅ Runner with trailing stop already exists! +- Runner size: 5% (configurable via `TAKE_PROFIT_2_SIZE_PERCENT=80`) +- Trailing stop: 0.3% fixed (configurable via `TRAILING_STOP_PERCENT=0.3`) ### Implementation Tasks: -- [ ] **Add trailing stop logic to Position Manager** - - [ ] Track `peakPrice` for runner portion - - [ ] Update `peakPrice` when current price exceeds it - - [ ] Calculate trailing stop distance: `peakPrice - (trailingStopATR × ATR)` - - [ ] Close runner when price crosses trailing stop +- [ ] **Analyze runner performance from existing trades** + - [ ] Query trades where runner was active (TP2 hit) + - [ ] Calculate: How many runners hit trailing stop vs kept going? + - [ ] Calculate: Average runner profit vs optimal exit + - [ ] Calculate: Was 0.3% trailing stop too tight? (got stopped out too early?) -- [ ] **Modify `checkTargets()` function:** - - [ ] After TP2 hit, activate `trailingStopActive = true` - - [ ] Monitor runner separately from main position - - [ ] Close runner with `closePosition()` when trailing stop breached +- [ ] **Optimize runner size by quality tier:** + - [ ] High quality (80-100): 25% runner (TP2 closes 0%, all becomes runner) + - [ ] Medium quality (70-79): 10% runner (TP2 closes 60% of remaining) + - [ ] Low quality (60-69): 5% runner (current behavior) -- [ ] **Add runner tracking to database:** - - [ ] `runnerSize` field (amount left after TP2) - - [ ] `runnerPeakPrice` field - - [ ] `runnerExitPrice` field - - [ ] `runnerExitReason` field ('trailing_stop', 'manual', etc.) +- [ ] **Make trailing stop ATR-based:** + - [ ] Change from fixed 0.3% to `(1.5 × ATR)` or `(2.0 × ATR)` + - [ ] Add `trailingStopATRMultiplier` config option + - [ ] Update Position Manager to use ATR-based trailing distance + - [ ] Store ATR value in ActiveTrade for dynamic calculations + +- [ ] **Add runner-specific analytics:** + - [ ] Dashboard widget: Runner performance stats + - [ ] Show: Total profit from runners vs TP1/TP2 + - [ ] Show: Average runner hold time + - [ ] Show: Runner win rate - [ ] **Testing:** - - [ ] Backtest: Simulate runners on TP2 trades - - [ ] Calculate: How much extra profit would runners have captured? - - [ ] Test with small position sizes first ($10-20) + - [ ] Backtest: Simulate larger runners (10-25%) on historical TP2 trades + - [ ] Backtest: Simulate ATR-based trailing stop vs fixed 0.3% + - [ ] A/B test: Run 10 trades with optimized settings before full rollout -- [ ] **Edge case handling:** - - [ ] What if runner goes negative after TP2? (Move SL to breakeven on runner) - - [ ] What if bot restarts with active runner? (Restore from database) - - [ ] What if on-chain runner order fails? (Position Manager backup) - -**Expected Outcome:** Capture extended moves like the +41% trade that's currently open +**Expected Outcome:** Capture more profit from extended moves, reduce premature trailing stop exits --- @@ -306,9 +314,9 @@ ORDER BY count DESC; - Entry: $182.73 - Current: $186.56 (+2.1%, +$11.30) - **Actual P&L: +41% unrealized** 🚀 -- Current strategy would've closed at +3% ($16.20) -- **Missed profit: ~$59** if this hits +41% realized -- **Lesson:** Need runner implementation ASAP once data supports it +- **Status:** TP1 hit (closed 75%), TP2 hit (closed 20%), 5% runner still active with trailing stop +- **Lesson:** The 5% runner captured this move! But could a larger runner (10-25%) capture even more? +- **Trailing stop:** 0.3% below peak might be too tight, ATR-based (1.5-2.0×ATR) might work better ### Key Metrics to Watch: - Win rate by quality tier