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

AlertDescriptionDefault
Trade EntryPosition opened✓ Enabled
Trade ExitPosition closed✓ Enabled
Order FilledOrder executed✓ Enabled
Order CancelledOrder cancelledOptional

Risk Alerts

AlertDescriptionTrigger
WarningApproaching limit75% of limit
BreachLimit exceeded100% of limit
Bot PausedAuto-pause triggeredRisk breach

System Alerts

AlertDescription
Connection ErrorExchange disconnected
Strategy ErrorStrategy execution failed
Balance WarningLow balance detected

Setting Up Alerts

1. Access Notification Settings

  1. Navigate to Settings → Notifications
  2. Or click the bell icon in the top navigation

2. Connect Email

Email alerts are enabled by default using your account email.

To change:

  1. Go to Settings → Account
  2. Update your email address
  3. Verify the new email

3. Connect Telegram

For instant mobile notifications:

  1. Start the Bot: Message @TradeStaqBot on Telegram
  2. Get Your Chat ID: Send /start to receive your Chat ID
  3. Enter Chat ID: Paste in Settings → Notifications → Telegram Chat ID
  4. 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
}
SettingDescriptionDefault
maxAlertsPerHourMaximum alerts per hour20
throttleSecondsSeconds between same alerts60
emailEnabledSend email alertstrue
telegramEnabledSend Telegram alertsfalse

Alert Levels

Alerts have different severity levels:

LevelIconUse CaseThrottling
Infoℹ️General informationStandard
Warning⚠️Potential issuesStandard
ErrorCritical problemsBypass
Trade Entry🟢Position openedStandard
Trade Exit🔴Position closedStandard

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

  1. Same Alert Throttle: Same alert title won't repeat for X seconds
  2. Hourly Limit: Maximum alerts per hour per bot
  3. 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

Email

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

  1. Check spam/junk folder
  2. Add noreply@tradestaq.com to contacts
  3. Verify email in Settings → Account
  4. Check alert preferences are enabled

Not Receiving Telegram Alerts

  1. Verify Chat ID is correct
  2. Send /start to @TradeStaqBot again
  3. Check Telegram notifications are on
  4. Test with "Send Test Message" button

Too Many Alerts

  1. Increase throttleSeconds
  2. Reduce maxAlertsPerHour
  3. Disable info-level alerts
  4. Review strategy alert logic

Alerts Delayed

  1. Email delivery can take 1-5 minutes
  2. Telegram should be instant
  3. Check TradeStaq status page
  4. High load may cause delays

Duplicate Alerts

  1. Check throttle settings
  2. Review strategy for duplicate calls
  3. Ensure only one bot per exchange
  4. 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