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:
@@ -26,6 +26,34 @@ Paste your bot token when asked.
|
||||
|
||||
## 📱 Using it on your phone
|
||||
|
||||
### Check Position Status
|
||||
Send `/status` to see your current open position with:
|
||||
- Real-time P&L (both $ amount and % of account)
|
||||
- Entry price and current price
|
||||
- TP1, TP2, and SL levels with status indicators
|
||||
- Position size and 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
|
||||
```
|
||||
|
||||
### Execute Trades
|
||||
Just send messages to your Telegram chat:
|
||||
```
|
||||
buy sol
|
||||
@@ -34,6 +62,14 @@ buy eth
|
||||
sell sol
|
||||
```
|
||||
|
||||
Or use commands:
|
||||
```
|
||||
/buySOL
|
||||
/sellBTC
|
||||
/buyETH
|
||||
/status
|
||||
```
|
||||
|
||||
The bot will:
|
||||
1. ✅ Parse your message
|
||||
2. ✅ Forward to n8n webhook
|
||||
|
||||
Reference in New Issue
Block a user