|
@@ -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
|