Live Trading
Notifications
Introduction
Set up some live trading notifications so that you are notified of market events and your algorithm's performance. We support email, SMS, webhooks, and Telegram notifications. If you set up notifications in the deployment wizard, we will notify you when your algorithm places orders or emits insights. To be notified at other moments in your algorithm, create notifications in your code files with the NotificationManager
. Lean ignores notifications during backtests. To view the number of notification you can send for free, see the Live Trading Notification Quotas.
Email notifications can include up to 10KB of text content in the message body. These notifications can be slow since they go through your email provider. If you don't receive an email notification that you're expecting, check your junk folders.
Follow these steps to set up email notifications in the deployment wizard:
- On the Deploy Live page, enable at least one of the notification types.
- Click .
- Enter an email address.
- Enter a subject.
- Click .
The following table shows the supported notification types:
Notification Type | Description |
---|---|
Order Events | Notifications for when the algorithm receives OrderEvent objects |
Insights | Notifications for when the algorithm emits Insight objects |
To add more email notifications, click
and then continue from step 2.SMS
SMS notifications are the only type of notification that you don't need an internet connection to receive. They can include up to 1,600 characters of text content in the message body.
Follow these steps to set up SMS notifications in the deployment wizard:
- On the Deploy Live page, enable at least one of the notification types.
- Click .
- Enter a phone number.
- Click .
The following table shows the supported notification types:
Notification Type | Description |
---|---|
Order Events | Notifications for when the algorithm receives OrderEvent objects |
Insights | Notifications for when the algorithm emits Insight objects |
To add more SMS notifications, click
and then continue from step 2.Telegram
Telegram notifications are automated messages to a Telegram group.
Follow these steps to set up Telegram notifications in the deployment wizard:
- On the Deploy Live page, enable at least one of the notification types.
- Create a new Telegram group.
- Add a bot to your Telegram group.
- On the live deployment wizard, click .
- Enter your user Id or group Id.
- If you are not using our notification bot, enter the token of your bot.
- Click .
The following table shows the supported notification types:
Notification Type | Description |
---|---|
Order Events | Notifications for when the algorithm receives OrderEvent objects |
Insights | Notifications for when the algorithm emits Insight objects |
To create a bot, chat with @BotFather and follow its instructions. If you want to use our bot, the username is @quantconnect_notifications_bot.
Your group Id is in the URL when you open your group chat in the Telegram web interface. For example, the group Id of web.telegram.org/z/#-503016366 is -503016366.
To add more Telegram notifications, click
and then continue from step 2.Webhooks
Webhook notifications are an HTTP-POST request to a URL you provide. The request is sent with a timeout of 300s. You can process these notifications on your web server however you want. For instance, you can inject the content of the notifications into your server's database or use it to create other notifications on your own server.
Follow these steps to set up webhook notifications in the deployment wizard:
- On the Deploy Live page, enable at least one of the notification types.
- Click .
- Enter a URL.
- If you want to add header information, click and then enter a key and value.
- Click .
The following table shows the supported notification types:
Notification Type | Description |
---|---|
Order Events | Notifications for when the algorithm receives OrderEvent objects |
Insights | Notifications for when the algorithm emits Insight objects |
Repeat this step to add multiple header keys and values.
To add more webhook notifications, click
and then continue from step 2.Quotas
The number of email, Telegram, or webhook notifications you can send in each live algorithm for free depends on the tier of your organization. The following table shows the hourly quotas:
Tier | Number of Notifications Per Hour |
---|---|
Free | N/A |
Quant Researcher | 20 |
Team | 60 |
Trading Firm | 240 |
Institution | 3,600 |
If you exceed the hourly quota, each additional email, Telegram, or webhook notification costs 1 QuantConnect Credit (QCC).
Each SMS notification you send to a US or Canadian phone number costs 1 QCC. Each SMS notification you send to an international phone number costs 10 QCC.