fix: Change revenge system to 1.0x position sizing (same as original)
**ISSUE:** User operates at 100% capital allocation - no room for 1.2x sizing - 1.2x would require 120% of capital (mathematically impossible) - User: 'thats not gonna work. we are already using 100% of our portfolio' **FIX:** Changed from 1.2x to 1.0x (same size as original trade) - Focus on capturing reversal, not sizing bigger - Maintains aggressive 15x leverage - Example: Original ,350 → Revenge ,350 (not 0,020) **FILES CHANGED:** - lib/trading/stop-hunt-tracker.ts: sizingMultiplier 1.2 → 1.0 - Telegram notification: Updated to show 'same as original' - Documentation: Updated all references to 1.0x strategy **DEPLOYED:** Nov 20, 2025 ~20:30 CET **BUILD TIME:** 71.8s, compiled successfully **STATUS:** Container running stable, stop hunt tracker operational
This commit is contained in:
12
.github/copilot-instructions.md
vendored
12
.github/copilot-instructions.md
vendored
@@ -3573,12 +3573,12 @@ All technical improvements must align with current phase objectives (see top of
|
|||||||
|
|
||||||
## Stop Hunt Revenge System (Nov 20, 2025)
|
## Stop Hunt Revenge System (Nov 20, 2025)
|
||||||
|
|
||||||
**Purpose:** Automatically re-enters positions after high-quality signals (score 85+) get stopped out, when price reverses back through original entry. Recovers losses faster by using 1.2x position size.
|
**Purpose:** Automatically re-enters positions after high-quality signals (score 85+) get stopped out, when price reverses back through original entry. Captures the reversal with same position size as original.
|
||||||
|
|
||||||
**Architecture:**
|
**Architecture:**
|
||||||
- **4-Hour Revenge Window:** Monitors for price reversal within 4 hours of stop-out
|
- **4-Hour Revenge Window:** Monitors for price reversal within 4 hours of stop-out
|
||||||
- **Quality Threshold:** Only quality score 85+ signals eligible (top-tier setups)
|
- **Quality Threshold:** Only quality score 85+ signals eligible (top-tier setups)
|
||||||
- **Position Size:** 1.2× original size (recover losses + profit faster)
|
- **Position Size:** 1.0× original size (same as original - user at 100% allocation)
|
||||||
- **One Revenge Per Stop Hunt:** Maximum 1 revenge trade per stop-out event
|
- **One Revenge Per Stop Hunt:** Maximum 1 revenge trade per stop-out event
|
||||||
- **Monitoring Interval:** 30-second price checks for active stop hunts
|
- **Monitoring Interval:** 30-second price checks for active stop hunts
|
||||||
- **Database:** StopHunt table (20 fields, 4 indexes) tracks all stop hunt events
|
- **Database:** StopHunt table (20 fields, 4 indexes) tracks all stop hunt events
|
||||||
@@ -3603,7 +3603,7 @@ if (direction === 'short' && currentPrice > originalEntryPrice + (0.005 * origin
|
|||||||
2. **Database:** Creates StopHunt record with entry price, quality score, ADX, ATR
|
2. **Database:** Creates StopHunt record with entry price, quality score, ADX, ATR
|
||||||
3. **Monitoring:** Background job checks every 30 seconds for price reversals
|
3. **Monitoring:** Background job checks every 30 seconds for price reversals
|
||||||
4. **Trigger:** Price crosses back through entry + 0.5% buffer within 4 hours
|
4. **Trigger:** Price crosses back through entry + 0.5% buffer within 4 hours
|
||||||
5. **Execution:** Calls `/api/trading/execute` with 1.2× position size, same direction
|
5. **Execution:** Calls `/api/trading/execute` with same position size, same direction
|
||||||
6. **Telegram:** Sends "🔥 REVENGE TRADE ACTIVATED" notification
|
6. **Telegram:** Sends "🔥 REVENGE TRADE ACTIVATED" notification
|
||||||
7. **Completion:** Updates database with revenge trade ID, marks revengeExecuted=true
|
7. **Completion:** Updates database with revenge trade ID, marks revengeExecuted=true
|
||||||
|
|
||||||
@@ -3648,7 +3648,7 @@ Original Trade:
|
|||||||
|
|
||||||
Revenge Trade:
|
Revenge Trade:
|
||||||
📍 Re-Entry: $138.20 SHORT
|
📍 Re-Entry: $138.20 SHORT
|
||||||
💪 Size: 1.2× original ($10,020 vs $8,350)
|
💪 Size: Same as original ($8,350)
|
||||||
🎯 Targets: TP1 +0.86%, TP2 +1.72%
|
🎯 Targets: TP1 +0.86%, TP2 +1.72%
|
||||||
|
|
||||||
Stop Hunt Reversal Confirmed ✓
|
Stop Hunt Reversal Confirmed ✓
|
||||||
@@ -3676,7 +3676,7 @@ const tracker = new StopHuntTracker() // ❌ Don't do this
|
|||||||
2. **Import path errors:** Use `'../database/trades'` not `'../database/client'`
|
2. **Import path errors:** Use `'../database/trades'` not `'../database/client'`
|
||||||
3. **Multiple instances:** Always use `getStopHuntTracker()` singleton getter
|
3. **Multiple instances:** Always use `getStopHuntTracker()` singleton getter
|
||||||
4. **Quality threshold:** Only 85+ eligible, don't lower without user approval
|
4. **Quality threshold:** Only 85+ eligible, don't lower without user approval
|
||||||
5. **Position size math:** 1.2× means execute with `originalSize * 1.2`, not +20%
|
5. **Position size math:** 1.0× means execute with `originalSize`, same as original trade
|
||||||
6. **Revenge window:** 4 hours from stop-out, not from signal generation
|
6. **Revenge window:** 4 hours from stop-out, not from signal generation
|
||||||
7. **One revenge limit:** Check `revengeExecuted` flag before executing again
|
7. **One revenge limit:** Check `revengeExecuted` flag before executing again
|
||||||
|
|
||||||
@@ -3685,7 +3685,7 @@ const tracker = new StopHuntTracker() // ❌ Don't do this
|
|||||||
- Stopped at $142.48 for -$138.35 loss
|
- Stopped at $142.48 for -$138.35 loss
|
||||||
- Price then dropped to $131.32 (8.8% move)
|
- Price then dropped to $131.32 (8.8% move)
|
||||||
- Missed +$490 potential profit if not stopped
|
- Missed +$490 potential profit if not stopped
|
||||||
- Revenge system would've re-entered SHORT at ~$141.50, captured $7-8+ profit
|
- Revenge system would've re-entered SHORT at ~$141.50 with same size, captured full reversal move
|
||||||
|
|
||||||
**Deployment Status:**
|
**Deployment Status:**
|
||||||
- ✅ Database schema created (StopHunt table with indexes)
|
- ✅ Database schema created (StopHunt table with indexes)
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ export class StopHuntTracker {
|
|||||||
originalTradeId: stopHunt.originalTradeId,
|
originalTradeId: stopHunt.originalTradeId,
|
||||||
stopHuntId: stopHunt.id,
|
stopHuntId: stopHunt.id,
|
||||||
originalLoss: stopHunt.stopLossAmount,
|
originalLoss: stopHunt.stopLossAmount,
|
||||||
sizingMultiplier: 1.2 // 20% larger position
|
sizingMultiplier: 1.0 // Same size as original (user at 100% allocation)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -315,7 +315,7 @@ export class StopHuntTracker {
|
|||||||
|
|
||||||
💀 Original Stop Hunt: -$${stopHunt.stopLossAmount.toFixed(2)}
|
💀 Original Stop Hunt: -$${stopHunt.stopLossAmount.toFixed(2)}
|
||||||
🎯 Revenge Entry: $${trade.entryPrice.toFixed(2)}
|
🎯 Revenge Entry: $${trade.entryPrice.toFixed(2)}
|
||||||
💪 Position Size: $${trade.positionSizeUSD.toFixed(2)} (1.2x)
|
💪 Position Size: $${trade.positionSizeUSD.toFixed(2)} (same as original)
|
||||||
|
|
||||||
⚔️ <b>TIME FOR PAYBACK!</b>
|
⚔️ <b>TIME FOR PAYBACK!</b>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user