Files
trading_bot_v4/.github
mindesbunister f8141009a8 docs: Document runner stop loss gap bug (Common Pitfall #34)
CRITICAL BUG DOCUMENTATION: Runner had ZERO stop loss protection between TP1-TP2

Context:
- User reported: 'runner close did not work. still open and the price is above 141,98'
- Investigation revealed Position Manager only checked SL before TP1 OR after TP2
- Runner between TP1-TP2 had NO stop loss checks = hours of unlimited loss exposure

Bug Impact:
- SHORT at $141.317, TP1 closed 70% at $140.942, runner had SL at $140.89
- Price rose to $141.98 (way above SL) → NO PROTECTION → Position stayed open
- Potential unlimited loss on 25-30% runner position

Fix Verification:
- After fix deployed: Runner closed at $141.133 with +$0.59 profit
- Database shows exitReason='SL', proving runner stop loss triggered correctly
- Log: '🔴 RUNNER STOP LOSS: SOL-PERP at 0.3% (profit lock triggered)'

Lesson: Every conditional branch in risk management MUST have explicit SL checks

Files: .github/copilot-instructions.md (added Common Pitfall #34)
2025-11-15 11:36:16 +01:00
..