|
@@ -10,16 +10,19 @@ The most important commands to get started:
|
|
|
/start # Show main menu with quick action buttons
|
|
|
/balance # Check your account balance
|
|
|
/long BTC 10 # Open long position with $10 USDC
|
|
|
+/long BTC 10 sl:9500 # Long with automatic stop loss
|
|
|
/sl BTC 9000 # Set stop loss at $9,000
|
|
|
/tp BTC 11000 # Set take profit at $11,000
|
|
|
/monitoring # Check order monitoring status
|
|
|
/performance # Token performance ranking
|
|
|
/daily # Daily performance (last 10 days)
|
|
|
/alarm BTC 50000 # Set price alert for BTC at $50,000
|
|
|
+/risk # Advanced risk metrics
|
|
|
+/version # Bot version and system info
|
|
|
/help # Full command reference
|
|
|
```
|
|
|
|
|
|
-**💡 Auto-Notifications:** The bot automatically monitors your orders every 30 seconds and sends notifications when orders are filled!
|
|
|
+**💡 Auto-Notifications:** The bot automatically monitors your orders every 10 seconds and sends notifications when orders are filled!
|
|
|
|
|
|
## 💼 Account Management
|
|
|
|
|
@@ -430,28 +433,40 @@ Show monthly performance breakdown for the last 10 months.
|
|
|
|
|
|
## 🚀 Perps Trading
|
|
|
|
|
|
-### `/long [token] [USDC amount] [price (optional)]`
|
|
|
-Open a long position using market order or limit order.
|
|
|
+### `/long [token] [USDC amount] [price (optional)] [sl:price (optional)]`
|
|
|
+Open a long position using market order or limit order, with optional automatic stop loss.
|
|
|
|
|
|
**Usage:**
|
|
|
```
|
|
|
-/long <TOKEN> <USDC_AMOUNT> # Market order
|
|
|
-/long <TOKEN> <USDC_AMOUNT> <PRICE> # Limit order
|
|
|
+/long <TOKEN> <USDC_AMOUNT> # Market order
|
|
|
+/long <TOKEN> <USDC_AMOUNT> <PRICE> # Limit order
|
|
|
+/long <TOKEN> <USDC_AMOUNT> sl:<STOP_PRICE> # Market order with stop loss
|
|
|
+/long <TOKEN> <USDC_AMOUNT> <PRICE> sl:<STOP_PRICE> # Limit order with stop loss
|
|
|
```
|
|
|
|
|
|
**Examples:**
|
|
|
```
|
|
|
-/long BTC 100 # Long Bitcoin with $100 USDC (Market Order)
|
|
|
-/long BTC 100 45000 # Long Bitcoin with $100 USDC at $45,000 (Limit Order)
|
|
|
-/long ETH 50 # Long Ethereum with $50 USDC (Market Order)
|
|
|
-/long ETH 50 3200 # Long Ethereum with $50 USDC at $3,200 (Limit Order)
|
|
|
+/long BTC 100 # Long Bitcoin with $100 USDC (Market Order)
|
|
|
+/long BTC 100 45000 # Long Bitcoin with $100 USDC at $45,000 (Limit Order)
|
|
|
+/long BTC 100 sl:44000 # Market order with automatic stop loss at $44,000
|
|
|
+/long BTC 100 45000 sl:44000 # Limit order at $45,000 with stop loss at $44,000
|
|
|
+/long ETH 50 # Long Ethereum with $50 USDC (Market Order)
|
|
|
+/long ETH 50 3200 # Long Ethereum with $50 USDC at $3,200 (Limit Order)
|
|
|
+/long ETH 50 sl:3100 # Market order with stop loss at $3,100
|
|
|
+/long ETH 50 3200 sl:3100 # Limit order with stop loss at $3,100
|
|
|
```
|
|
|
|
|
|
+**Stop Loss Validation:**
|
|
|
+- For LONG positions: Stop loss price must be BELOW entry price
|
|
|
+- Stop loss is placed automatically when the original order fills
|
|
|
+- Uses `sl:price` format to distinguish from limit price
|
|
|
+
|
|
|
**How it works:**
|
|
|
1. **Market Order** (2 parameters): Fetches current market price and places market buy order
|
|
|
2. **Limit Order** (3 parameters): Places limit buy order at specified price
|
|
|
-3. Calculates token amount: `token_amount = usdc_amount / price`
|
|
|
-4. Records trade in statistics
|
|
|
+3. **With Stop Loss**: Saves stop loss for automatic placement when order fills
|
|
|
+4. Calculates token amount: `token_amount = usdc_amount / price`
|
|
|
+5. Records trade in statistics
|
|
|
|
|
|
**Market Order Confirmation:**
|
|
|
```
|
|
@@ -491,28 +506,40 @@ Open a long position using market order or limit order.
|
|
|
⚠️ Are you sure you want to open this long position?
|
|
|
```
|
|
|
|
|
|
-### `/short [token] [USDC amount] [price (optional)]`
|
|
|
-Open a short position using market order or limit order.
|
|
|
+### `/short [token] [USDC amount] [price (optional)] [sl:price (optional)]`
|
|
|
+Open a short position using market order or limit order, with optional automatic stop loss.
|
|
|
|
|
|
**Usage:**
|
|
|
```
|
|
|
-/short <TOKEN> <USDC_AMOUNT> # Market order
|
|
|
-/short <TOKEN> <USDC_AMOUNT> <PRICE> # Limit order
|
|
|
+/short <TOKEN> <USDC_AMOUNT> # Market order
|
|
|
+/short <TOKEN> <USDC_AMOUNT> <PRICE> # Limit order
|
|
|
+/short <TOKEN> <USDC_AMOUNT> sl:<STOP_PRICE> # Market order with stop loss
|
|
|
+/short <TOKEN> <USDC_AMOUNT> <PRICE> sl:<STOP_PRICE> # Limit order with stop loss
|
|
|
```
|
|
|
|
|
|
**Examples:**
|
|
|
```
|
|
|
-/short BTC 100 # Short Bitcoin with $100 USDC (Market Order)
|
|
|
-/short BTC 100 46000 # Short Bitcoin with $100 USDC at $46,000 (Limit Order)
|
|
|
-/short ETH 50 # Short Ethereum with $50 USDC (Market Order)
|
|
|
-/short ETH 50 3400 # Short Ethereum with $50 USDC at $3,400 (Limit Order)
|
|
|
+/short BTC 100 # Short Bitcoin with $100 USDC (Market Order)
|
|
|
+/short BTC 100 46000 # Short Bitcoin with $100 USDC at $46,000 (Limit Order)
|
|
|
+/short BTC 100 sl:47000 # Market order with automatic stop loss at $47,000
|
|
|
+/short BTC 100 46000 sl:47000 # Limit order at $46,000 with stop loss at $47,000
|
|
|
+/short ETH 50 # Short Ethereum with $50 USDC (Market Order)
|
|
|
+/short ETH 50 3400 # Short Ethereum with $50 USDC at $3,400 (Limit Order)
|
|
|
+/short ETH 50 sl:3500 # Market order with stop loss at $3,500
|
|
|
+/short ETH 50 3400 sl:3500 # Limit order with stop loss at $3,500
|
|
|
```
|
|
|
|
|
|
+**Stop Loss Validation:**
|
|
|
+- For SHORT positions: Stop loss price must be ABOVE entry price
|
|
|
+- Stop loss is placed automatically when the original order fills
|
|
|
+- Uses `sl:price` format to distinguish from limit price
|
|
|
+
|
|
|
**How it works:**
|
|
|
1. **Market Order** (2 parameters): Fetches current market price and places market sell order
|
|
|
2. **Limit Order** (3 parameters): Places limit sell order at specified price
|
|
|
-3. Calculates token amount: `token_amount = usdc_amount / price`
|
|
|
-4. Records trade in statistics
|
|
|
+3. **With Stop Loss**: Saves stop loss for automatic placement when order fills
|
|
|
+4. Calculates token amount: `token_amount = usdc_amount / price`
|
|
|
+5. Records trade in statistics
|
|
|
|
|
|
**Market Order Confirmation:**
|
|
|
```
|
|
@@ -819,7 +846,7 @@ Will trigger when BTC price moves above $50,000.00
|
|
|
|
|
|
⏰ Created: 14:25:30
|
|
|
|
|
|
-💡 The alarm will be checked every 30 seconds and you'll receive a notification when triggered.
|
|
|
+💡 The alarm will be checked every 10 seconds and you'll receive a notification when triggered.
|
|
|
```
|
|
|
|
|
|
**List All Alarms:**
|
|
@@ -904,7 +931,7 @@ Will trigger when BTC price moves above $50,000.00
|
|
|
|
|
|
## 🔄 Order Monitoring & Notifications
|
|
|
|
|
|
-The bot automatically monitors your orders and positions every 30 seconds and sends real-time notifications when orders are filled.
|
|
|
+The bot automatically monitors your orders and positions every 10 seconds and sends real-time notifications when orders are filled.
|
|
|
|
|
|
### Automatic Notifications
|
|
|
|
|
@@ -999,7 +1026,7 @@ Check the status of all monitoring systems.
|
|
|
|
|
|
📊 Order Monitoring:
|
|
|
• Active: ✅ Yes
|
|
|
-• Check Interval: 30 seconds
|
|
|
+• Check Interval: 10 seconds
|
|
|
• Orders Tracked: 3
|
|
|
• Positions Tracked: 2
|
|
|
|
|
@@ -1111,6 +1138,121 @@ View log file statistics and manage log cleanup.
|
|
|
✅ Log cleanup completed!
|
|
|
```
|
|
|
|
|
|
+### `/risk`
|
|
|
+Show advanced risk metrics and portfolio analysis.
|
|
|
+
|
|
|
+**Example:**
|
|
|
+```
|
|
|
+/risk
|
|
|
+```
|
|
|
+
|
|
|
+**Response:**
|
|
|
+```
|
|
|
+📊 Risk Analysis & Advanced Metrics
|
|
|
+
|
|
|
+🎯 Risk-Adjusted Performance:
|
|
|
+• Sharpe Ratio: 1.850
|
|
|
+• Sortino Ratio: 2.410
|
|
|
+• Annual Volatility: 12.30%
|
|
|
+
|
|
|
+📉 Drawdown Analysis:
|
|
|
+• Maximum Drawdown: 8.50%
|
|
|
+• Value at Risk (95%): 3.20%
|
|
|
+
|
|
|
+💰 Portfolio Context:
|
|
|
+• Current Balance: $1,150.00
|
|
|
+• Initial Balance: $1,000.00
|
|
|
+• Total P&L: $150.00
|
|
|
+• Days Active: 30
|
|
|
+
|
|
|
+📊 Risk Interpretation:
|
|
|
+• 🟢 Good risk-adjusted returns (Sharpe > 1.0)
|
|
|
+• 🟢 Low maximum drawdown (< 15%)
|
|
|
+• 🟡 Moderate portfolio volatility (< 25%)
|
|
|
+
|
|
|
+💡 Risk Definitions:
|
|
|
+• Sharpe Ratio: Risk-adjusted return (excess return / volatility)
|
|
|
+• Sortino Ratio: Return / downside volatility (focuses on bad volatility)
|
|
|
+• Max Drawdown: Largest peak-to-trough decline
|
|
|
+• VaR 95%: Maximum expected loss 95% of the time
|
|
|
+• Volatility: Annualized standard deviation of returns
|
|
|
+
|
|
|
+📈 Data Based On:
|
|
|
+• Completed Trades: 25
|
|
|
+• Daily Balance Records: 30
|
|
|
+• Trading Period: 30 days
|
|
|
+```
|
|
|
+
|
|
|
+### `/version`
|
|
|
+Show bot version and system information.
|
|
|
+
|
|
|
+**Example:**
|
|
|
+```
|
|
|
+/version
|
|
|
+```
|
|
|
+
|
|
|
+**Response:**
|
|
|
+```
|
|
|
+🤖 Trading Bot Version & System Info
|
|
|
+
|
|
|
+📱 Bot Information:
|
|
|
+• Version: v2.0.0
|
|
|
+• Network: Mainnet
|
|
|
+• Uptime: 2d 5h 30m
|
|
|
+• Default Token: BTC
|
|
|
+
|
|
|
+💻 System Information:
|
|
|
+• Python: 3.11.5
|
|
|
+• Platform: Darwin arm64
|
|
|
+• Architecture: arm64
|
|
|
+
|
|
|
+📊 Trading Stats:
|
|
|
+• Total Orders: 45
|
|
|
+• Completed Trades: 25
|
|
|
+• Days Active: 30
|
|
|
+• Start Date: 2024-01-15
|
|
|
+
|
|
|
+🔄 Monitoring Status:
|
|
|
+• Order Monitoring: ✅ Active
|
|
|
+• External Trades: ✅ Active
|
|
|
+• Price Alarms: ✅ Active (5 active)
|
|
|
+• Risk Management: ❌ Disabled
|
|
|
+
|
|
|
+⏰ Current Time: 2024-12-15 14:25:30
|
|
|
+```
|
|
|
+
|
|
|
+### `/balance_adjustments`
|
|
|
+Show deposit and withdrawal history for accurate P&L tracking.
|
|
|
+
|
|
|
+**Example:**
|
|
|
+```
|
|
|
+/balance_adjustments
|
|
|
+```
|
|
|
+
|
|
|
+**Response:**
|
|
|
+```
|
|
|
+💰 Balance Adjustments History
|
|
|
+
|
|
|
+📊 Summary:
|
|
|
+• Total Deposits: $500.00
|
|
|
+• Total Withdrawals: $200.00
|
|
|
+• Net Adjustment: $300.00
|
|
|
+• Total Transactions: 3
|
|
|
+
|
|
|
+📅 Recent Adjustments:
|
|
|
+• 💰 12/15 09:30: +$200.00
|
|
|
+• 💸 12/10 16:45: -$150.00
|
|
|
+• 💰 12/05 11:20: +$300.00
|
|
|
+
|
|
|
+💡 How it Works:
|
|
|
+• Bot checks for deposits/withdrawals every hour
|
|
|
+• Adjustments maintain accurate P&L calculations
|
|
|
+• Non-trading balance changes don't affect performance metrics
|
|
|
+• Trading statistics remain pure and accurate
|
|
|
+
|
|
|
+⏰ Last Check: 12/15 14:00
|
|
|
+```
|
|
|
+
|
|
|
## 💡 Pro Tips
|
|
|
|
|
|
### **🎯 Best Practices**
|
|
@@ -1172,13 +1314,13 @@ View log file statistics and manage log cleanup.
|
|
|
### **🛡️ Safety Features**
|
|
|
- **Confirmation dialogs** for all trades
|
|
|
- **Auto-notifications** for order fills
|
|
|
-- **Real-time monitoring** every 30 seconds
|
|
|
+- **Real-time monitoring** every 10 seconds
|
|
|
- **Comprehensive logging** of all activities
|
|
|
- **Price alerts** for key levels
|
|
|
- **External trade detection** and sync
|
|
|
|
|
|
### **🔄 Order Monitoring**
|
|
|
-- **30-second intervals** for order fill detection
|
|
|
+- **10-second intervals** for order fill detection
|
|
|
- **Automatic P&L calculation** for closed positions
|
|
|
- **Position change tracking** (opens, closes, increases)
|
|
|
- **Instant Telegram notifications** for all fills
|