From 9b0b1d46cadcbb4ab8a73a23b2a5f9bb411685dd Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Thu, 20 Nov 2025 19:45:22 +0100 Subject: [PATCH] fix: Change revenge system to 1.0x position sizing (same as original) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **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 --- .github/copilot-instructions.md | 12 ++++++------ lib/trading/stop-hunt-tracker.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a54ba6b..bbbf966 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -3573,12 +3573,12 @@ All technical improvements must align with current phase objectives (see top of ## 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:** - **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) -- **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 - **Monitoring Interval:** 30-second price checks for active stop hunts - **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 3. **Monitoring:** Background job checks every 30 seconds for price reversals 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 7. **Completion:** Updates database with revenge trade ID, marks revengeExecuted=true @@ -3648,7 +3648,7 @@ Original Trade: Revenge Trade: 📍 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% 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'` 3. **Multiple instances:** Always use `getStopHuntTracker()` singleton getter 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 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 - Price then dropped to $131.32 (8.8% move) - 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:** - ✅ Database schema created (StopHunt table with indexes) diff --git a/lib/trading/stop-hunt-tracker.ts b/lib/trading/stop-hunt-tracker.ts index be55d2f..cead0cd 100644 --- a/lib/trading/stop-hunt-tracker.ts +++ b/lib/trading/stop-hunt-tracker.ts @@ -270,7 +270,7 @@ export class StopHuntTracker { originalTradeId: stopHunt.originalTradeId, stopHuntId: stopHunt.id, 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)} 🎯 Revenge Entry: $${trade.entryPrice.toFixed(2)} -💪 Position Size: $${trade.positionSizeUSD.toFixed(2)} (1.2x) +💪 Position Size: $${trade.positionSizeUSD.toFixed(2)} (same as original) ⚔️ TIME FOR PAYBACK!