📲 SMS Notification Configuration Guide¶
QuantDinger supports SMS notifications via Twilio, ensuring you receive critical trading signals anywhere.
📋 Table of Contents¶
- Prerequisites
- About Twilio
- Configuration Steps
- Step 1: Create a Twilio Account
- Step 2: Obtain API Credentials
- Step 3: Get a Phone Number
- Step 4: Configure Environment Variables
- Step 5: Enable SMS Notifications in Strategy
- Pricing Information
- Troubleshooting
Prerequisites¶
- A valid phone number to receive SMS messages
- A credit/debit card for Twilio billing (trial accounts include free credits)
- QuantDinger backend service deployed and running
About Twilio¶
Twilio is a leading cloud communications platform providing reliable SMS services worldwide.
Why Twilio? - ✅ Global coverage in 180+ countries - ✅ High deliverability and reliability - ✅ Pay-as-you-go pricing, no monthly fees - ✅ Free trial credits for new users - ✅ Comprehensive API documentation and support
Configuration Steps¶
Step 1: Create a Twilio Account¶
- Visit Twilio Sign Up
- Click Sign Up to create a new account
- Fill in your email, password, and basic information
- Verify your email and phone number
- Complete account activation
💡 Tip: New users receive $15 USD in free trial credits.
Step 2: Obtain API Credentials¶
After registration, access the Twilio Console:
- Log in to Twilio Console
- Locate the Account Info section on the Dashboard
- Note the following information:
- Account SID: Format
ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Auth Token: Click to reveal and copy (keep this secure)
⚠️ Security Notice: The Auth Token is essentially your API password. Never share it publicly. If compromised, regenerate it immediately in the console.
Step 3: Get a Phone Number¶
You need a Twilio phone number as the SMS sender:
- In Twilio Console, navigate to Phone Numbers → Manage → Buy a number
- Select a country and check the SMS capability
- Choose and purchase a number (trial accounts get one free number)
- Note your Twilio phone number (format:
+1xxxxxxxxxx)
Number Selection Tips: - Choose a number from the same country as recipients to reduce costs - For international recipients, consider the destination country's regulations - Some countries require sender ID registration
Step 4: Configure Environment Variables¶
Add Twilio parameters to your backend_api_python/.env file:
# =========================
# Phone / SMS Configuration (Twilio)
# =========================
# Twilio Account SID (required)
# Format: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Twilio Auth Token (required)
# Obtained from Twilio Console
TWILIO_AUTH_TOKEN=your_auth_token_here
# Twilio Sender Number (required)
# Format: +CountryCodeNumber, e.g., +14155552671
TWILIO_FROM_NUMBER=+14155552671
Restart the backend service after configuration to apply changes.
Step 5: Enable SMS Notifications in Strategy¶
In the strategy configuration page under "Signal Notifications":
- Enable the Phone notification channel
- Enter the recipient phone number in the designated field
Number Format Requirements:
- Must include country code
- Format: +CountryCodeNumber
- Examples:
- United States: +14155552671
- United Kingdom: +447911123456
- Germany: +4915112345678
- Australia: +61412345678
💡 Tip: You can enter multiple numbers (comma-separated) for multi-recipient notifications.
Pricing Information¶
Twilio uses pay-as-you-go pricing. SMS costs vary by destination:
| Destination | Approx. Cost (USD/message) |
|---|---|
| United States | $0.0079 |
| Canada | $0.0075 |
| United Kingdom | $0.04 |
| Germany | $0.07 |
| Australia | $0.05 |
| Japan | $0.08 |
| India | $0.04 |
💰 Note: For current pricing, visit Twilio SMS Pricing. Prices may change.
Trial Account Limitations: - $15 USD free credits - Can only send to verified phone numbers - Messages include "Sent from your Twilio trial account" prefix
Upgrade to a paid account to remove these limitations.
Troubleshooting¶
Q: Can trial accounts send to any number?¶
No. Trial accounts can only send to verified phone numbers. Add and verify recipient numbers in Twilio Console under Verified Caller IDs. Upgrade to a paid account for unrestricted sending.
Q: Send failed with invalid number error?¶
- Ensure correct format with country code (e.g.,
+14155552671) - Remove spaces, dashes, or special characters from the number
- Verify the recipient can receive international SMS
Q: Messages not delivered to certain countries?¶
- Some carriers may block international SMS
- Check country-specific regulations (some require sender ID registration)
- Verify the destination country is supported by Twilio
- Contact Twilio support for country-specific issues
Q: How to check delivery status?¶
Log in to Twilio Console → Monitor → Logs → Messaging to view all SMS records, delivery status, and error details.
Q: Auth Token was compromised?¶
Immediately log in to Twilio Console → Account → API Credentials → Click Regenerate Auth Token.
Q: Are there alternatives to Twilio?¶
QuantDinger currently only supports Twilio as the SMS provider. For other services, use the Webhook channel to integrate: - Nexmo (Vonage) - AWS SNS - MessageBird - Plivo
Complete Environment Variable Reference¶
# Twilio SMS Configuration
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Account SID
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Auth Token
TWILIO_FROM_NUMBER=+14155552671 # Sender number
