docs: Update Telegram notifications section for TP1 partial closes

- Updated section header: Nov 16, 2025 → Nov 16, 2025 - Enhanced Nov 20, 2025
- Added TP1 partial close notification to implemented features list
- Enhanced notification format example with runner split
- Added Key Features section explaining immediate TP1 feedback
- Updated commits list: b1ca454 (Nov 16) + 79e7ffe (Nov 20)
- Clarified separate notifications for TP1 and runner closures
This commit is contained in:
mindesbunister
2025-11-20 17:44:33 +01:00
parent 79e7ffe2c0
commit e99bd32a9f

View File

@@ -3526,12 +3526,13 @@ All technical improvements must align with current phase objectives (see top of
- Comparison with executed trades at similar quality levels - Comparison with executed trades at similar quality levels
- Future automation of price tracking (would TP1/TP2/SL have hit?) - Future automation of price tracking (would TP1/TP2/SL have hit?)
## Telegram Notifications (Nov 16, 2025) ## Telegram Notifications (Nov 16, 2025 - Enhanced Nov 20, 2025)
**Position Closure Notifications:** System sends direct Telegram messages for all position closures via `lib/notifications/telegram.ts` **Position Closure Notifications:** System sends direct Telegram messages for all position closures via `lib/notifications/telegram.ts`
**Implemented for:** **Implemented for:**
- TP1/TP2 exits (Position Manager auto-exits) - **TP1 partial closes (NEW Nov 20, 2025):** Immediate notification when TP1 hits (60% closed)
- **Runner exits:** Full close notifications when remaining position exits (TP2/SL/trailing)
- Stop loss triggers (SL, soft SL, hard SL, emergency) - Stop loss triggers (SL, soft SL, hard SL, emergency)
- Manual closures (via API or settings UI) - Manual closures (via API or settings UI)
- Ghost position cleanups (external closure detection) - Ghost position cleanups (external closure detection)
@@ -3549,18 +3550,26 @@ All technical improvements must align with current phase objectives (see top of
🎯 Exit: $172.45 🎯 Exit: $172.45
⏱ Hold Time: 1h 23m ⏱ Hold Time: 1h 23m
🔚 Exit: TP1 🔚 Exit: TP1 (60% closed, 40% runner remaining)
📈 Max Gain: +3.12% 📈 Max Gain: +3.12%
📉 Max Drawdown: -0.45% 📉 Max Drawdown: -0.45%
``` ```
**Key Features (Nov 20, 2025):**
- **Immediate TP1 feedback:** User sees profit as soon as TP1 hits, doesn't wait for runner to close
- **Partial close details:** Exit reason shows percentage split (e.g., "TP1 (60% closed, 40% runner remaining)")
- **Separate notifications:** TP1 close gets one notification, runner close gets another
- **Complete P&L tracking:** Each notification shows its portion of realized P&L
**Configuration:** Requires `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` in .env **Configuration:** Requires `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHAT_ID` in .env
**Code location:** **Code location:**
- `lib/notifications/telegram.ts` - sendPositionClosedNotification() - `lib/notifications/telegram.ts` - sendPositionClosedNotification()
- `lib/trading/position-manager.ts` - Integrated in executeExit() and handleExternalClosure() - `lib/trading/position-manager.ts` - Integrated in executeExit() (both partial and full closes) and handleExternalClosure()
**Commit:** b1ca454 "feat: Add Telegram notifications for position closures" **Commits:**
- b1ca454 "feat: Add Telegram notifications for position closures" (Nov 16, 2025)
- 79e7ffe "feat: Add Telegram notification for TP1 partial closes" (Nov 20, 2025)
## Integration Points ## Integration Points