feat: Add /status command to Telegram bot for position monitoring
- Implemented /status command handler in telegram_command_bot.py - Shows real-time P&L, entry/current prices, TP/SL levels, position info - Added TRADING_BOT_URL and API_SECRET_KEY environment variables - Updated docker-compose.telegram-bot.yml with new env vars - Bot connects to trading-bot-v4:3000 API via internal Docker network - Added comprehensive documentation and testing guides - Command displays formatted position info with emojis (profit/loss indicators) - Shows 'No open positions' message when no trades active
This commit is contained in:
66
STATUS_COMMAND_QUICKREF.txt
Normal file
66
STATUS_COMMAND_QUICKREF.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
╔════════════════════════════════════════════════════════════════╗
|
||||
║ TELEGRAM /status COMMAND ║
|
||||
║ ✅ READY TO USE ║
|
||||
╚════════════════════════════════════════════════════════════════╝
|
||||
|
||||
📱 HOW TO USE
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
1. Open your Telegram bot chat
|
||||
2. Send: /status
|
||||
3. Get instant position info!
|
||||
|
||||
📊 WHAT YOU'LL SEE
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
✅ Current P&L ($ and % of account)
|
||||
✅ Entry price & current price
|
||||
✅ TP1, TP2, and SL levels with status
|
||||
✅ Position size & leverage
|
||||
✅ Trade age in minutes
|
||||
|
||||
🎯 EXAMPLE OUTPUT
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
🟢 SOL-PERP 📈 LONG
|
||||
|
||||
💰 P&L: $3.50 (+0.70% account)
|
||||
📊 Price Change: +0.07%
|
||||
|
||||
Entry: $142.5000
|
||||
Current: $142.6000
|
||||
|
||||
Targets:
|
||||
TP1: $143.4975 ⏳
|
||||
TP2: $144.6375
|
||||
SL: $140.3625
|
||||
|
||||
Position: $500.00 @ 10x
|
||||
Age: 5 min
|
||||
|
||||
🔧 TECHNICAL STATUS
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
✅ Container: telegram-trade-bot (Running)
|
||||
✅ Network: Connected to trading-bot-v4
|
||||
✅ API: Authenticated & tested
|
||||
✅ Command: /status handler active
|
||||
|
||||
📝 ALL COMMANDS
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
/status → Show current position
|
||||
/buySOL → Long SOL
|
||||
/sellSOL → Short SOL
|
||||
/buyBTC → Long BTC
|
||||
/sellBTC → Short BTC
|
||||
/buyETH → Long ETH
|
||||
/sellETH → Short ETH
|
||||
|
||||
🔐 SECURITY
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
✅ Only works in YOUR chat (579304651)
|
||||
✅ API authentication required
|
||||
✅ Internal Docker network
|
||||
✅ No internet exposure
|
||||
|
||||
🎉 READY!
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
Open Telegram and send /status to try it now!
|
||||
|
||||
Next: Open a position, then check /status to see it in action! 🚀
|
||||
Reference in New Issue
Block a user