Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Email on Strategy disable ?

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

    #16
    Yes, I know how to send a mail but do not forget my original request : "I would like to send a mail when a strategy is disabled". At this time I can not track such an event because logs cannot be read in real time and automatically in a script.
    Thanks for your help.

    Comment


      #17
      nextjob,

      Please use SendMail() in OnTermination().
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        I will try this.
        Thanks

        Comment


          #19
          It should be noted that OnTermination() is for NT7 only.
          Josh P.NinjaTrader Customer Service

          Comment


            #20
            NT,

            In the sample below I try to use the sendmail function, however, whenever I have an exception the function does not work. Neither of the sendmail functions work, but the print does print the exception to the output window..

            Btw, the email functionality does work when there is NO exception.

            Here's a sample from the OnBarUpdate:
            try {
            SendMail("[email protected]","[email protected]", "exception was raised", "Test" );

            int test = 10;
            test = 10 - 10;
            test = 5 / test;

            } //End Try Block

            catch (Exception e) {
            Print(" Exception: " + e.ToString());
            SendMail("[email protected]","[email protected]", "OnBarUpdate Exception Executed", "Test " );
            }
            Last edited by tradingGary; 10-10-2010, 07:58 PM.

            Comment


              #21
              Gary, do you see any log errors reported? If you see the Print triggered, you should be able to trigger SendMail() as well.

              Comment


                #22
                Bertrand, there were no errors in the logs. I am not an expert reading the trace file, but didn't see anything in there either.
                I am using NT7 v22, using replay April 28th 2010, ES 06-10

                Here's the exception that is printed in the output window:
                Exception: System.DivideByZeroException: Attempted to divide by zero.

                Btw, if you look at the code, the sendmail function is executed before the exception happens, but it still does not work.
                Very strange.
                Thanks,
                Gary
                Last edited by tradingGary; 10-11-2010, 07:11 AM.

                Comment


                  #23
                  Thanks Gary - would you mind sending me the strategy you run to my Attn to support at ninjatrader dot com so I could give it a run here on my end?

                  Comment


                    #24
                    Bertrand,

                    Sent you the strategy. Please let me know.
                    Thank you,
                    Gary

                    Comment


                      #25
                      Gary,

                      I have responded to your email with the analysis on the situation.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #26
                        Josh & Gary, what was the problem? Inquiring minds would like to know. I also have this problem from time to time.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        608 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        355 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        105 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        560 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        561 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X