Email Alerts - futures io
futures io futures trading



Email Alerts


Discussion in NinjaTrader

Updated by shodson
      Top Posters
    1. looks_one shodson with 3 posts (8 thanks)
    2. looks_two wh with 1 posts (2 thanks)
    3. looks_3 HarryThompson with 1 posts (0 thanks)
    4. looks_4 ratfink with 1 posts (0 thanks)
    1. trending_up 7,449 views
    2. thumb_up 11 thanks given
    3. group 7 followers
    1. forum 8 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Email Alerts

(login for full post details)
  #1 (permalink)
nashville,TN
 
 
Posts: 3 since Jan 2010
Thanks: 0 given, 0 received

Hi,
Has anyone gotten the email alert to work correctly in ninja trader. I have tried a couple DLL's posted but never seemed to get it to send emails when a condition happened. Any thoughts would be appreciated
Thanks

Reply With Quote

 
 
(login for full post details)
  #2 (permalink)
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 298 given, 501 received

look at ninjatrader api

if you use dll, you bind correctly?

if condition
SendMail(string from, string to, string subject, string text);
else condition
SendMail(string from, string to, string subject, string text);

works well for me

best regards

ps

// Generates an email message
SendMail("support@ninjatrader.com", "customer@winners.com", "Trade Alert", "Buy ES");

Causality is the relationship between an event (the cause) and a second event (the effect), where the second event is a consequence of the first.
Reply With Quote
The following 2 users say Thank You to wh for this post:
 
(login for full post details)
  #3 (permalink)
Charkov
 
 
Posts: 4 since Jan 2010
Thanks: 2 given, 0 received



wh View Post
look at ninjatrader api

if you use dll, you bind correctly?

if condition
SendMail(string from, string to, string subject, string text);
else condition
SendMail(string from, string to, string subject, string text);

works well for me

best regards

ps

// Generates an email message
SendMail("support@ninjatrader.com", "customer@winners.com", "Trade Alert", "Buy ES");

thanks
I try use it

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Market Wizard
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,941 since Jun 2009
Thanks: 510 given, 3,588 received

This doesn't work for me because my ISP (Cox) requires all email be sent through their own local SMTP server and when I try to configure the SMTP settings in NinjaTrader it still doesn't work. So I implemented my own email method that seems to work for me. First, add this to the top of your strategy/indicator

 
Code
using System.Net.Mail;
Then, anywhere else inside of your class...

 
Code
private void SendMailLocal(string to, string from, string subject, string body, string smtp)
{
    // Don't send emails on historical data      
    if (Historical)
        return;
    
    try
    {
        MailMessage mailMsg = new MailMessage();
        mailMsg.To.Add(to);

        MailAddress mailAddress = new MailAddress(from);
        mailMsg.From = mailAddress;

        mailMsg.Subject = subject;
        mailMsg.Body    = body;

        SmtpClient smtpClient = new SmtpClient(smtp);
        smtpClient.Send(mailMsg);
    }
    catch (Exception ex)
    {
        Print(ex.Message.ToString());
    }
}

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to shodson for this post:
 
(login for full post details)
  #5 (permalink)
Manchester UK
 
 
Posts: 1 since Aug 2013
Thanks: 3 given, 0 received

Hi

Shodson, tried to use your method to send emails since I also experience problems when setting up through my ISP. When calling the method you describe, what do you use for describing the SMTP client?

And appologies for any daft questions, I am new to both NT and programming.

Reg

Kruus



shodson View Post
This doesn't work for me because my ISP (Cox) requires all email be sent through their own local SMTP server and when I try to configure the SMTP settings in NinjaTrader it still doesn't work. So I implemented my own email method that seems to work for me. First, add this to the top of your strategy/indicator

 
Code
using System.Net.Mail;
Then, anywhere else inside of your class...

 
Code
private void SendMailLocal(string to, string from, string subject, string body, string smtp)
{
    // Don't send emails on historical data      
    if (Historical)
        return;
    
    try
    {
        MailMessage mailMsg = new MailMessage();
        mailMsg.To.Add(to);

        MailAddress mailAddress = new MailAddress(from);
        mailMsg.From = mailAddress;

        mailMsg.Subject = subject;
        mailMsg.Body    = body;

        SmtpClient smtpClient = new SmtpClient(smtp);
        smtpClient.Send(mailMsg);
    }
    catch (Exception ex)
    {
        Print(ex.Message.ToString());
    }
}


Reply With Quote
 
(login for full post details)
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,904 since Jun 2009
Thanks: 31,586 given, 94,531 received


Kruus View Post
Hi

Shodson, tried to use your method to send emails since I also experience problems when setting up through my ISP. When calling the method you describe, what do you use for describing the SMTP client?

And appologies for any daft questions, I am new to both NT and programming.

Reg

Kruus

Just a note that some ISP's will block port 25.

You can use port 587 usually with popular services like Gmail and Yahoo I think.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #7 (permalink)
Market Wizard
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,941 since Jun 2009
Thanks: 510 given, 3,588 received


Kruus View Post
Hi

Shodson, tried to use your method to send emails since I also experience problems when setting up through my ISP. When calling the method you describe, what do you use for describing the SMTP client?

And appologies for any daft questions, I am new to both NT and programming.

Reg

Kruus

The method I posted over three years ago only works if you have access to an open SMTP server you are allowed to send through, which may vary depending on which local area network your Ninjascript is running on.

I have since moved away from this approach and send all of my emails through a Gmail account which can work from any place on the internet.

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to shodson for this post:
 
(login for full post details)
  #8 (permalink)
Birmingham UK
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
 
ratfink's Avatar
 
Posts: 3,652 since Dec 2012
Thanks: 17,422 given, 8,386 received

Hi @Kruus, I thought Ninja used to send emails through it's own SMTP server if you just left the fields blank, or have they stopped doing that?

edit: Just did a test off the laptop free licence Ninja using the Options->Misc 'Test..' button and it still works fine with all server fields left blank.

edit2: and do check your spam settings/folders

Travel Well
Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
Market Wizard
OC, California, USA
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Trading: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,941 since Jun 2009
Thanks: 510 given, 3,588 received


ratfink View Post
Hi @Kruus, I thought Ninja used to send emails through it's own SMTP server if you just left the fields blank, or have they stopped doing that?

edit: Just did a test off the laptop free licence Ninja using the Options->Misc 'Test..' button and it still works fine with all server fields left blank.

edit2: and do check your spam settings/folders

The problem for me was that my ISP (Cox) blocks accessing SMTP servers outside of their network via blocking port 25 in order to prevent spam being originated from their network. This meant that I could never use the built-in way. With a Gmail acct and the aforementioned method it works for me anywhere since I don't know of any ISPs that block Gmail's SMTP port (587)

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to shodson for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Email Alerts


December 20, 2013


Upcoming Webinars and Events
 

Every journal equals ten meals for the hungry

Now
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts