diff --git a/docs/V11_ANALYSIS_DEC15_2025.md b/docs/V11_ANALYSIS_DEC15_2025.md index 286f4a1..dbd04d7 100644 --- a/docs/V11_ANALYSIS_DEC15_2025.md +++ b/docs/V11_ANALYSIS_DEC15_2025.md @@ -1,5 +1,36 @@ # v11 Indicator Analysis - December 15, 2025 +## 🛡️ BUG #87 FIX DEPLOYED - PHASE 2 ACTIVE SL RECOVERY + +**Status:** ✅ PHASE 2 DEPLOYED (Dec 15, 2025 13:30 UTC) +**Git Commit:** dcee117 "enhance: Bug #87 Phase 2 - Active SL recovery at 60s/90s" +**Container:** trading-bot-v4 (image sha256:4eaef891...) + +### Phase 2 Enhancement: Hybrid Passive + Active Recovery + +**User Requirement:** "30sec after position was opened it shall only check. after 60s and 90s check if it does not exist it shall try to place the SL. if both attempts on 60 and 90 fail then stop trading and close position" + +**Implementation:** +- **Attempt 1 (30s):** Passive verification only (give initial placement time to propagate) +- **Attempt 2 (60s):** Check + attemptSLPlacement() if missing (active recovery #1) +- **Attempt 3 (90s):** Check + attemptSLPlacement() if missing (active recovery #2) +- **Emergency:** haltTradingAndClosePosition() if both recovery attempts fail + +**New Function:** `attemptSLPlacement(tradeId, symbol, marketIndex)` +- Loads trade from database (positionSizeUSD, entryPrice, stopLossPrice, takeProfit1Price, takeProfit2Price) +- Calls placeExitOrders() with tp1SizePercent=0, tp2SizePercent=0 (SL orders only) +- Updates database with SL signatures (slOrderTx, softStopOrderTx, hardStopOrderTx) if successful +- Returns true on success, false on failure + +**Benefits:** +- Maximizes trade survival by attempting recovery before emergency shutdown +- Two recovery chances reduce false positive halts (60s + 90s) +- 30s passive first gives initial placement reasonable Drift propagation time + +**Next Trade:** Monitor logs for Phase 2 behavior verification + +--- + ## Executive Summary **Overall Performance:** 7 trades, 57.1% win rate, -$1.80 total P&L