Lean  $LEAN_TAG$
QuantConnect.Notifications.NotificationManager Class Reference

Local/desktop implementation of messaging system for Lean Engine. More...

Public Member Functions

 NotificationManager (bool liveMode)
 Initialize the messaging system More...
 
bool Email (string address, string subject, string message, string data, PyObject headers)
 Send an email to the address specified for live trading notifications. More...
 
bool Email (string address, string subject, string message, string data="", Dictionary< string, string > headers=null)
 Send an email to the address specified for live trading notifications. More...
 
bool Sms (string phoneNumber, string message)
 Send an SMS to the phone number specified More...
 
bool Web (string address, object data, PyObject headers)
 Place REST POST call to the specified address with the specified DATA. Python overload for Headers parameter. More...
 
bool Web (string address, object data=null, Dictionary< string, string > headers=null)
 Place REST POST call to the specified address with the specified DATA. More...
 
bool Telegram (string id, string message, string token=null)
 Send a telegram message to the chat ID specified, supply token for custom bot. Note: Requires bot to have chat with user or be in the group specified by ID. More...
 
bool Ftp (string hostname, string username, string password, string filePath, byte[] fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over unsecure FTP. More...
 
bool Ftp (string hostname, string username, string password, string filePath, string fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over unsecure FTP. More...
 
bool Sftp (string hostname, string username, string password, string filePath, byte[] fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over SFTP. More...
 
bool Sftp (string hostname, string username, string password, string filePath, string fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over SFTP. More...
 
bool Sftp (string hostname, string username, string privateKey, string privateKeyPassphrase, string filePath, byte[] fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over SFTP using SSH keys. More...
 
bool Sftp (string hostname, string username, string privateKey, string privateKeyPassphrase, string filePath, string fileContent, int? port=null)
 Send a file to the FTP specified server using password authentication over SFTP using SSH keys. More...
 

Properties

ConcurrentQueue< NotificationMessages [get, set]
 Public access to the messages More...
 

Detailed Description

Local/desktop implementation of messaging system for Lean Engine.

Definition at line 26 of file NotificationManager.cs.

Constructor & Destructor Documentation

◆ NotificationManager()

QuantConnect.Notifications.NotificationManager.NotificationManager ( bool  liveMode)

Initialize the messaging system

Definition at line 44 of file NotificationManager.cs.

Member Function Documentation

◆ Email() [1/2]

bool QuantConnect.Notifications.NotificationManager.Email ( string  address,
string  subject,
string  message,
string  data,
PyObject  headers 
)

Send an email to the address specified for live trading notifications.

Parameters
subjectSubject of the email
messageMessage body, up to 10kb
dataData attachment (optional)
addressEmail address to send to
headersOptional email headers to use

Definition at line 62 of file NotificationManager.cs.

◆ Email() [2/2]

bool QuantConnect.Notifications.NotificationManager.Email ( string  address,
string  subject,
string  message,
string  data = "",
Dictionary< string, string >  headers = null 
)

Send an email to the address specified for live trading notifications.

Parameters
subjectSubject of the email
messageMessage body, up to 10kb
dataData attachment (optional)
addressEmail address to send to
headersOptional email headers to use

Definition at line 75 of file NotificationManager.cs.

◆ Sms()

bool QuantConnect.Notifications.NotificationManager.Sms ( string  phoneNumber,
string  message 
)

Send an SMS to the phone number specified

Parameters
phoneNumberPhone number to send to
messageMessage to send

Definition at line 93 of file NotificationManager.cs.

◆ Web() [1/2]

bool QuantConnect.Notifications.NotificationManager.Web ( string  address,
object  data,
PyObject  headers 
)

Place REST POST call to the specified address with the specified DATA. Python overload for Headers parameter.

Parameters
addressEndpoint address
dataData to send in body JSON encoded
headersOptional headers to use

Definition at line 113 of file NotificationManager.cs.

◆ Web() [2/2]

bool QuantConnect.Notifications.NotificationManager.Web ( string  address,
object  data = null,
Dictionary< string, string >  headers = null 
)

Place REST POST call to the specified address with the specified DATA.

Parameters
addressEndpoint address
dataData to send in body JSON encoded (optional)
headersOptional headers to use

Definition at line 124 of file NotificationManager.cs.

◆ Telegram()

bool QuantConnect.Notifications.NotificationManager.Telegram ( string  id,
string  message,
string  token = null 
)

Send a telegram message to the chat ID specified, supply token for custom bot. Note: Requires bot to have chat with user or be in the group specified by ID.

Parameters
idChat or group ID to send message to
messageMessage to send
tokenBot token to use for this message

Definition at line 144 of file NotificationManager.cs.

◆ Ftp() [1/2]

bool QuantConnect.Notifications.NotificationManager.Ftp ( string  hostname,
string  username,
string  password,
string  filePath,
byte[]  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over unsecure FTP.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
passwordThe FTP server password
filePathThe path to file on the FTP server
fileContentThe contents of the file
portThe FTP server port. Defaults to 21

Definition at line 166 of file NotificationManager.cs.

Here is the caller graph for this function:

◆ Ftp() [2/2]

bool QuantConnect.Notifications.NotificationManager.Ftp ( string  hostname,
string  username,
string  password,
string  filePath,
string  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over unsecure FTP.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
passwordThe FTP server password
filePathThe path to file on the FTP server
fileContentThe string contents of the file
portThe FTP server port. Defaults to 21

Definition at line 180 of file NotificationManager.cs.

Here is the call graph for this function:

◆ Sftp() [1/4]

bool QuantConnect.Notifications.NotificationManager.Sftp ( string  hostname,
string  username,
string  password,
string  filePath,
byte[]  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over SFTP.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
passwordThe FTP server password
filePathThe path to file on the FTP server
fileContentThe contents of the file
portThe FTP server port. Defaults to 21

Definition at line 194 of file NotificationManager.cs.

Here is the call graph for this function:

◆ Sftp() [2/4]

bool QuantConnect.Notifications.NotificationManager.Sftp ( string  hostname,
string  username,
string  password,
string  filePath,
string  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over SFTP.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
passwordThe FTP server password
filePathThe path to file on the FTP server
fileContentThe string contents of the file
portThe FTP server port. Defaults to 21

Definition at line 208 of file NotificationManager.cs.

Here is the call graph for this function:

◆ Sftp() [3/4]

bool QuantConnect.Notifications.NotificationManager.Sftp ( string  hostname,
string  username,
string  privateKey,
string  privateKeyPassphrase,
string  filePath,
byte[]  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over SFTP using SSH keys.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
privateKeyThe private SSH key to use for authentication
privateKeyPassphraseThe optional passphrase to decrypt the private key. This can be empty or null if the private key is not encrypted
filePathThe path to file on the FTP server
fileContentThe contents of the file
portThe FTP server port. Defaults to 21

Definition at line 224 of file NotificationManager.cs.

◆ Sftp() [4/4]

bool QuantConnect.Notifications.NotificationManager.Sftp ( string  hostname,
string  username,
string  privateKey,
string  privateKeyPassphrase,
string  filePath,
string  fileContent,
int?  port = null 
)

Send a file to the FTP specified server using password authentication over SFTP using SSH keys.

Parameters
hostnameFTP server hostname
usernameThe FTP server username
privateKeyThe private SSH key to use for authentication
privateKeyPassphraseThe optional passphrase to decrypt the private key. This can be empty or null if the private key is not encrypted
filePathThe path to file on the FTP server
fileContentThe string contents of the file
portThe FTP server port. Defaults to 21

Definition at line 249 of file NotificationManager.cs.

Property Documentation

◆ Messages

ConcurrentQueue<Notification> QuantConnect.Notifications.NotificationManager.Messages
getset

Public access to the messages

Definition at line 39 of file NotificationManager.cs.


The documentation for this class was generated from the following file: