Trading Alerts
TradeStaq includes a comprehensive alert system that notifies you about trading activity, risk events, and strategy signals. This guide explains how to configure and use trading alerts.
Overview
The alert system provides:
- Trade Notifications - Entry and exit alerts
- Risk Alerts - Limit breaches and warnings
- Strategy Alerts - Custom alerts from your strategies
- Multi-Channel - Email and Telegram support
- Smart Throttling - Prevents notification spam
Alert Types
Trade Alerts
| Alert | Description | Default |
|---|---|---|
| Trade Entry | Position opened | ✓ Enabled |
| Trade Exit | Position closed | ✓ Enabled |
| Order Filled | Order executed | ✓ Enabled |
| Order Cancelled | Order cancelled | Optional |
Risk Alerts
| Alert | Description | Trigger |
|---|---|---|
| Warning | Approaching limit | 75% of limit |
| Breach | Limit exceeded | 100% of limit |
| Bot Paused | Auto-pause triggered | Risk breach |
System Alerts
| Alert | Description |
|---|---|
| Connection Error | Exchange disconnected |
| Strategy Error | Strategy execution failed |
| Balance Warning | Low balance detected |
Setting Up Alerts
1. Access Notification Settings
- Navigate to Settings → Notifications
- Or click the bell icon in the top navigation
2. Connect Email
Email alerts are enabled by default using your account email.
To change:
- Go to Settings → Account
- Update your email address
- Verify the new email
3. Connect Telegram
For instant mobile notifications:
- Start the Bot: Message @TradeStaqBot on Telegram
- Get Your Chat ID: Send
/startto receive your Chat ID - Enter Chat ID: Paste in Settings → Notifications → Telegram Chat ID
- Test Connection: Click "Send Test Message"
4. Configure Alert Preferences
For each alert type, you can:
- Enable/disable the alert
- Choose delivery channels (Email, Telegram, or both)
- Set custom thresholds (for risk alerts)
Alert Configuration
Basic Settings
{
"emailEnabled": true,
"telegramEnabled": true,
"tradeAlerts": true,
"riskAlerts": true,
"systemAlerts": true
}
Advanced Settings
{
"maxAlertsPerHour": 20,
"throttleSeconds": 60,
"emailEnabled": true,
"telegramEnabled": true
}
| Setting | Description | Default |
|---|---|---|
maxAlertsPerHour | Maximum alerts per hour | 20 |
throttleSeconds | Seconds between same alerts | 60 |
emailEnabled | Send email alerts | true |
telegramEnabled | Send Telegram alerts | false |
Alert Levels
Alerts have different severity levels:
| Level | Icon | Use Case | Throttling |
|---|---|---|---|
| Info | ℹ️ | General information | Standard |
| Warning | ⚠️ | Potential issues | Standard |
| Error | ❌ | Critical problems | Bypass |
| Trade Entry | 🟢 | Position opened | Standard |
| Trade Exit | 🔴 | Position closed | Standard |
Priority Handling
- Critical alerts (errors, risk breaches) bypass throttling
- Trade alerts follow standard throttling
- Info alerts are most throttled to prevent spam
Custom Strategy Alerts
Send alerts from your TradeStaq strategies:
Basic Alert
td.alert({
level: 'info',
title: 'Signal Detected',
message: 'RSI oversold condition met',
});
Alert with Data
td.alert({
level: 'warning',
title: 'High Volatility Detected',
message: 'ATR has exceeded 2x normal range',
data: {
currentATR: atrValue,
normalATR: avgATR,
ratio: atrValue / avgATR,
},
});
Trade Entry Alert
// Automatic alert on trade entry
td.trade.long({
size: 0.1,
alertTitle: 'Long Entry - BTC',
alertMessage: 'RSI oversold + MA crossover confirmed',
alertData: {
rsi: currentRSI,
entryPrice: td.market.price,
stopLoss: stopLossPrice,
},
});
Alert Levels in Strategies
// Info - General information
td.alert({ level: 'info', title: 'Strategy Started', message: '...' });
// Warning - Potential concerns
td.alert({ level: 'warning', title: 'Approaching Limit', message: '...' });
// Error - Critical issues
td.alert({ level: 'error', title: 'Execution Failed', message: '...' });
// Trade Entry
td.alert({ level: 'trade_entry', title: 'Position Opened', message: '...' });
// Trade Exit
td.alert({ level: 'trade_exit', title: 'Position Closed', message: '...' });
Throttling
Throttling prevents alert spam when markets are volatile.
How Throttling Works
- Same Alert Throttle: Same alert title won't repeat for X seconds
- Hourly Limit: Maximum alerts per hour per bot
- Critical Bypass: System errors bypass throttling
Default Throttle Settings
┌─────────────────────────────────────────────────────────────┐
│ THROTTLE BEHAVIOR │
│ │
│ Alert: "RSI Oversold" │
│ │
│ 12:00:00 → Sent ✓ │
│ 12:00:30 → Throttled (60s not elapsed) │
│ 12:01:15 → Sent ✓ │
│ 12:02:00 → Sent ✓ │
│ │
│ Hourly Count: 3 of 20 │
└─────────────────────────────────────────────────────────────┘
Adjusting Throttle
For high-frequency strategies:
{
"maxAlertsPerHour": 50,
"throttleSeconds": 30
}
For low-frequency strategies:
{
"maxAlertsPerHour": 10,
"throttleSeconds": 300
}
Alert Formats
Email Alert Example
Subject: [TRADE_ENTRY] Long Entry - BTC - MyTradingBot
┌─────────────────────────────────────────────────────────────┐
│ │
│ 🟢 TradeStaq Alert │
│ MyTradingBot • BTC/USDT │
│ │
├─────────────────────────────────────────────────────────────┤
│ │
│ Long Entry - BTC │
│ RSI oversold + MA crossover confirmed │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Additional Data │ │
│ │ • RSI: 28.5 │ │
│ │ • Entry Price: $50,123.45 │ │
│ │ • Stop Loss: $49,120.98 │ │
│ └────────────────────────────────────────────────────────┘ │
│ │
├─────────────────────────────────────────────────────────────┤
│ Jan 12, 2026 10:30:45 AM • Alert Level: TRADE_ENTRY │
└─────────────────────────────────────────────────────────────┘
Telegram Alert Example
🟢 TradeStaq Alert
MyTradingBot • BTC/USDT
Long Entry - BTC
RSI oversold + MA crossover confirmed
Data:
• RSI: 28.5
• Entry Price: $50,123.45
• Stop Loss: $49,120.98
Jan 12, 2026 10:30:45 AM • TRADE_ENTRY
Risk Alert Examples
Daily Loss Warning (75%)
⚠️ TradeStaq Alert
MyTradingBot • BTC/USDT
Risk Warning - Approaching Daily Limit
You have used 75% of your daily loss limit.
Data:
• Daily Loss: -$225.00 (-2.25%)
• Daily Limit: 3%
• Remaining: 0.75%
Consider reducing position size or pausing trading.
Daily Loss Breach (100%)
❌ TradeStaq Alert
MyTradingBot • BTC/USDT
Risk Limit Breached - Bot Paused
Daily loss limit has been exceeded. Bot has been automatically paused.
Data:
• Daily Loss: -$312.50 (-3.12%)
• Daily Limit: 3%
• Status: Paused
Action Required: Review positions and resume bot manually.
Notification Channels
Pros:
- Reliable delivery
- Full formatting support
- Permanent record
- Works offline (queued)
Cons:
- Slower delivery (seconds to minutes)
- May go to spam
- Requires email checking
Best For:
- Trade summaries
- End-of-day reports
- Critical system alerts
Telegram
Pros:
- Instant delivery
- Mobile notifications
- Real-time awareness
- Easy setup
Cons:
- Requires Telegram app
- May miss if phone is silent
- Limited formatting
Best For:
- Trade entry/exit alerts
- Risk warnings
- Real-time monitoring
Recommended Setup
For active trading:
- Telegram: Trade alerts, risk warnings
- Email: Daily summaries, critical errors
For passive monitoring:
- Email: All alerts
- Telegram: Critical only
Managing Alert Volume
Strategy 1: Filter by Level
Only enable critical alerts:
{
"infoAlerts": false,
"warningAlerts": true,
"errorAlerts": true,
"tradeAlerts": true
}
Strategy 2: Channel by Type
- Trade alerts → Telegram only
- Risk alerts → Both
- System alerts → Email only
Strategy 3: Increase Throttle
For noisy strategies:
{
"throttleSeconds": 300,
"maxAlertsPerHour": 10
}
Strategy 4: Alert in Strategy
Control alerts from your strategy logic:
// Only alert on significant moves
if (pnlPercent > 2 || pnlPercent < -1) {
td.alert({
level: 'info',
title: 'Significant P&L',
message: `Position P&L: ${pnlPercent.toFixed(2)}%`,
});
}
Troubleshooting
Not Receiving Email Alerts
- Check spam/junk folder
- Add noreply@tradestaq.com to contacts
- Verify email in Settings → Account
- Check alert preferences are enabled
Not Receiving Telegram Alerts
- Verify Chat ID is correct
- Send
/startto @TradeStaqBot again - Check Telegram notifications are on
- Test with "Send Test Message" button
Too Many Alerts
- Increase
throttleSeconds - Reduce
maxAlertsPerHour - Disable info-level alerts
- Review strategy alert logic
Alerts Delayed
- Email delivery can take 1-5 minutes
- Telegram should be instant
- Check TradeStaq status page
- High load may cause delays
Duplicate Alerts
- Check throttle settings
- Review strategy for duplicate calls
- Ensure only one bot per exchange
- Contact support if persists
API Reference
Get Alert Configuration
GET /api/user/alert-config
Update Alert Configuration
PATCH /api/user/alert-config
Content-Type: application/json
{
"emailEnabled": true,
"telegramEnabled": true,
"telegramChatId": "123456789",
"maxAlertsPerHour": 20,
"throttleSeconds": 60
}
Get Alert Stats
GET /api/tradedroid/bots/{botId}/alerts/stats
Response:
{
"hourlyCount": 5,
"todayCount": 23,
"lastAlertAt": "2026-01-12T10:30:45Z"
}
Next Steps
- Risk Management - Configure risk alerts
- Creating Strategies - Add alerts to strategies
- Telegram Setup - Detailed Telegram guide
- Monitoring - Dashboard alerts