Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

mailing alert messages

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mailing alert messages

    I am confused. I got email to work from ninjatrader. I setup market analyzer. At least the basics, I have alerts in market analyzer that appear in the alert box. And the also play a wave file and change colors,

    However, under options/Misc it says "Mail alert messages to: and has a space to put your email address. I put my email address there.

    I now expect my alerts to be emailed to that address. But they are not.

    Does this mean that that message does not mean what I thought? Can NinjaTrader email me the alerts automatically?

    I don't know what else "Mail alert messages to" could mean. Did I miss some step?

    Thank you

    #2
    Hello mcteague,

    Thank you for your post.

    Do you see any errors in your Log tab of the NinjaTrader Control Center?

    You should be able to send e-mail messages of the alert messages with that setting. Please check the Log tab for any errors regarding send mail.

    I look forward to your response.

    Comment


      #3
      I do not see any relevant errors in the log. But I think some ambiguity in your phrase "You should be able to send e-mail messages of the alert messages with that setting". may require clarification.

      I can send email messages and alerts. "I" do not want to. Imagine that I am in outer space. But my computer back on earth is running ninjatrader. I have my alerts setup. When the alerts trigger I want ninja trader to email them to me in outer space. That is I, the user, do not want to have do anything to email the alert once it is set up.
      I do not want to have to be in front of the computer. If I am in front of the computer I can see the alert. Why would I want to email to myself if I am there? I want them sent when I am not there. To anywhere like magic, Even outerspace. Can ninjatrader do that. ( With out my having to hire a c# programmer)

      Thanks

      Comment


        #4
        Hello mcteague,

        Thank you for your response.

        The e-mails should send automatically. Please send me your log and trace files so I may investigate this matter further. Please send them to support[at]ninjatrader[dot]com. You can do this by going to the Control Center-> Help-> Mail to Support.

        Please please 'ATTN: Patrick' in the subject line and a reference to this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=55067

        I look forward to assisting you further.

        Comment


          #5
          Patrick, would it be possible to set-up an email alert for when connection to the broker drops? i've an issue, approx once o twice a week my API with Interactive Brokers drops and I end up with live positions still running, it would be useful to have an email, text msg alert in this occasion, do you think this is possible to programm?

          Comment


            #6
            Hello sburtt,

            Thank you for your post.

            You can send an e-mail for a disconnect of your data feed in NinjaTrader by creating a NinjaScript Strategy that uses the OnConnectionStatus() method to check the connection status and if it is disconnected send an e-mail alert using SendMail().

            For information on OnConnectionStatus() please visit the following link: http://www.ninjatrader.com/support/h...tionstatus.htm

            For information on SendMail() please visit the following link: http://www.ninjatrader.com/support/h...7/sendmail.htm

            Please let me know if I may be of further assistance.

            Comment


              #7
              Hi Patrick, to make sure I have understood, please could you answer these 2 questions:


              1. when compiling the SendMail script should I use support[at]ninjatrader.com in the field "From email address"?? or should I use my own email?
              Basically what I want to to understand is if the email is generated by NT or does NT connect to my MS Office Outlook?

              2. Despite I am programming my own strategies, I am NOT at expert programmer, therefore I would need a little assistance to make sure I fully understood
              and make it work, the best thing is to use a simple example. Assume this is my strategy:

              [...]

              protected override void Initialize()
              {
              CalculateOnBarClose = true;
              EntryHandling = EntryHandling.UniqueEntries;
              ExitOnClose = false;
              }

              protected override void OnBarUpdate()

              {
              EntryHandling = EntryHandling.UniqueEntries;


              if (CrossAbove(ITrend(gamma).Value,ITrend(gamma).Lag, 1))
              EnterShort();


              if (CrossBelow(ITrend(gamma).Value,ITrend(gamma).Lag, 1))
              EnterLong();
              }

              [...]

              would this alteration make sure I receive an email when connection status is different from connected?

              [...]

              protected override void Initialize()
              {
              CalculateOnBarClose = true;
              EntryHandling = EntryHandling.UniqueEntries;
              ExitOnClose = false;
              }

              protected override void OnBarUpdate()

              {
              EntryHandling = EntryHandling.UniqueEntries;

              if (dataFeed != ConnectionStatus.Connected)
              {
              SendMail("support[at]ninjatrader.com", "[email protected]", "Connection Alert", "Connection Lost with IB");
              }



              if (CrossAbove(ITrend(gamma).Value,ITrend(gamma).Lag, 1))
              EnterShort();


              if (CrossBelow(ITrend(gamma).Value,ITrend(gamma).Lag, 1))
              EnterLong();
              }

              [...]

              if this is wrong (very likely), would you be so kind to help me out figure the right code. Thanks for your time
              Last edited by NinjaTrader_Matthew; 02-13-2013, 04:03 PM.

              Comment


                #8
                Hello sburtt,

                Thank you for your response.

                1. You would use your own e-mail address. It would be sent from the NinjaTrader platform.

                2. Your alteration is correct, the best way to find out if this works is to test it out on your end. You can shut down TWS outside of NinjaTrader while you are connected and then see if you get an e-mail for the disconnect.

                Please let me know if I may be of further assistance.
                Last edited by NinjaTrader_PatrickH; 02-15-2013, 08:12 AM.

                Comment


                  #9
                  Patrick, i basically created a new strategy called ConnectionControl and added the the code described above in the protected override void OnOrderUpdate()

                  I then had to add the following code in the Variable section
                  private ConnectionStatus dataFeed = ConnectionStatus.Connected;


                  I am now running the strategy live an a casual instrument (for example EURUSD 1 min) to test if it works. I can't shut down as I have live strats running, but I will let you know if it works.


                  last thing, in the script SendMail("support[at]ninjatrader.com",[...] should I leave the ninjatrader email or replace with mine?



                  Thanks in advanced, John
                  Last edited by NinjaTrader_Matthew; 02-13-2013, 04:02 PM.

                  Comment


                    #10
                    Hello sburtt,

                    Thank you for your response.

                    Replace the support[at]ninjatrader[dot]com with your e-mail address.

                    Please let me know if I may be of further assistance.

                    Comment


                      #11
                      I must be honest, i tried the script as described below, but it is not working, no emails are sent, are you sure the code is correct? Could you pls send me a cs. file of how I could receive an email on a simple 50-100 EMA crossover? This would help as I could copy the code

                      Thanks

                      Comment


                        #12
                        Hello sburtt,

                        Thank you for your response.

                        Below is an example of sending an e-mail for a CrossAbove condition:
                        Code:
                        if(CrossAbove(EMA(50), EMA(100), 1))
                        			{
                        				SendMail("[email protected]", "[email protected]", "This is the subject line.", "This is my message.");
                        			}
                        I beleive your case is not what syntax or code is being used by a SMTP error. Please check your Log tab of your Control Center, are there any errors listed? If so, please detail in your response.

                        I look forward to your response.

                        Comment


                          #13
                          thanks, it actually works.

                          reason why it wasn't working was i was trying to use it to receive an alert when connection from broker to NT disconnects, using the script private ConnectionStatus dataFeed = ConnectionStatus.Connected;

                          Comment


                            #14
                            Patrick

                            would it be possible to receive also the price of the EntryLong() in the email alert below? How should I modify the following code?

                            Code:
                            if(CrossAbove(EMA(50), EMA(100), 1))
                            			{
                            EnterLong();
                            SendMail("[email protected]", "[email protected]", "Trade Alert", "Long Entry at");
                            			}

                            Comment


                              #15
                              Hello sburtt,

                              Thank you for your response.

                              You would place the SendMail in the the OnExecution method and send the information with price.

                              For example:
                              Code:
                              protected override void OnBarUpdate()
                              {
                              if (entryOrder == null && CrossAbove(EMA(50), EMA(100), 1))
                              {
                              entryOrder = EnterLong();
                              }
                              }
                               
                              protected override void OnExecution(IExecution execution)
                              {
                              if (entryOrder != null && entryOrder == execution.Order)
                              SendMail("[email protected]", "[email protected]", "Trade Alert", "Long Entry at " + execution.Price);
                              }
                              For information on OnExecution please visit the following link: http://www.ninjatrader.com/support/h...nexecution.htm

                              For a reference sample on using OnExecution please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=7499

                              Please let me know if I may be of further assistance.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              111 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              59 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              38 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              42 views
                              0 likes
                              Last Post TheRealMorford  
                              Started by Mindset, 02-28-2026, 06:16 AM
                              0 responses
                              78 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Working...
                              X