소스 검색

Enhance notification messages in PositionTracker to include usage tips

- Updated notification messages in PositionTracker to append a usage tip for checking current positions.
- Improved formatting of leverage, PnL, and size change messages for better readability.
- Ensured consistent messaging across different notification scenarios to enhance user experience.
Carles Sentis 22 시간 전
부모
커밋
300157daae
2개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 4
      src/monitoring/position_tracker.py
  2. 1 1
      trading_bot.py

+ 8 - 4
src/monitoring/position_tracker.py

@@ -274,7 +274,8 @@ class PositionTracker:
                 f"Side: {side}\n"
                 f"Size: {abs(size):.4f}\n"
                 f"Entry: ${position['entry_px']:.4f}\n"
-                f"Leverage: {position.get('current_leverage', position['max_leverage']):.1f}x"
+                f"Leverage: {position.get('current_leverage', position['max_leverage']):.1f}x\n\n"
+                f"💡 Use /positions to see current positions"
             )
             
             await self.notification_manager.send_generic_notification(message)
@@ -341,7 +342,8 @@ class PositionTracker:
                     f"Size: {size:.4f}\n"
                     f"Entry: ${entry_price:.4f}\n"
                     f"Exit: ${current_price:.4f}\n"
-                    f"PnL: ${realized_pnl:.3f}"
+                    f"PnL: ${realized_pnl:.3f}\n\n"
+                    f"💡 Use /positions to see current positions"
                 )
                 
                 await self.notification_manager.send_generic_notification(message)
@@ -379,7 +381,8 @@ class PositionTracker:
                         f"⚖️ Leverage {change_direction}\n"
                         f"Token: {symbol}\n"
                         f"Side: {side}\n"
-                        f"Leverage: {prev_leverage:.1f}x → {curr_leverage:.1f}x"
+                        f"Leverage: {prev_leverage:.1f}x → {curr_leverage:.1f}x\n\n"
+                        f"💡 Use /positions to see current positions"
                     )
                     await self.notification_manager.send_generic_notification(message)
                 
@@ -395,7 +398,8 @@ class PositionTracker:
                     f"Token: {symbol}\n"
                     f"Side: {side}\n"
                     f"New Size: {abs(curr_size):.4f}\n"
-                    f"Change: {'+' if size_change > 0 else ''}{size_change:.4f}"
+                    f"Change: {'+' if size_change > 0 else ''}{size_change:.4f}\n\n"
+                    f"💡 Use /positions to see current positions"
                 )
                 
                 await self.notification_manager.send_generic_notification(message)

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 
 # Bot version
-BOT_VERSION = "2.6.300"
+BOT_VERSION = "2.6.301"
 
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))