Sendmailchart Function

This strategy includes one function SendMailChart, which emails a strategy's active chart to a specified email account. The strategy includes sample strategy logic to test the function, suggest running it in simulation mode on a 1 or 2 minute chart. Many emails may be produced, so cancel after waiting a few bars.

The function uses the Smtp client and some .NET Imaging functions to capture the ChartControl image and email it as an attachment, along with supplied text. These components are not supported by NinjaTrader, so use with caution, and at your own risk of course.

It will not work as expected in backtesting mode, as the indicators are not likely yet drawn when your strategy signals determine an email should be sent.

To use the function, paste it into a strategy namespace and call it as shown in the sample strategy. Smtp requires more parameters than SendMail, reference Outlook account settings and your email provider for these settings (host, port, etc.).

For information on SmtpClient, see these links:

http://www.davidmillington.net/news/index.php/2005/12/18/using_smtpclient_credentials
http://msdn.microsoft.com/en‐us/library/system.net.mail.smtpclient.aspx
You can find information on image capture and streams on the MSDN and CodeProject websites.

Happy chart emailing!

01/08/2009

OregonSun

Created By OregonSun
NinjaTrader Version 7
File Size 9.6 KB
Create Date 07/13/2010
# of Downloads 1119

Importing to NinjaTrader 7 is Easy!

To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:

  1. Download the app or add-on file to your desktop
  2. From the NinjaTrader Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file from your desktop

Questions?

Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.