Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to send an alert (email) when Automated Strategy STOPS

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

    How to send an alert (email) when Automated Strategy STOPS

    Hi,

    Was wondering if there is any way Ninjatrader can send an alert (such as an email) whenever the strategy STOPS. This can happen for many reasons, such as an order reject.

    Thank you for any help,

    dax3k

    #2
    dax3k,

    You will need to custom program this yourself through SendMail().
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Thanks for your reply. When you say 'custom program', do you mean writing custom code within NinjaTrader, inside my strategy? or do you mean a 3rd party application?

      Also, how can I check if the strategy has STOPPED? is there a particular function that does this?

      The issue is that when the strategy STOPS, the code can no longer be executed.

      Thanks for you help,

      dax3k

      Comment


        #4
        Originally posted by dax3k View Post
        Hi Josh,

        Thanks for your reply. When you say 'custom program', do you mean writing custom code within NinjaTrader, inside my strategy? or do you mean a 3rd party application?

        Also, how can I check if the strategy has STOPPED? is there a particular function that does this?

        The issue is that when the strategy STOPS, the code can no longer be executed.

        Thanks for you help,

        dax3k
        Just a thought: maybe you can override Dispose method, so when strategy is disposing it will shoot you an email.

        Comment


          #5
          You would need to program it in your strategy. If you are using manual trades unfortunately this is not possible.

          For a strategy you could try roonius' proposal. Otherwise it may get a little hairy because you would effectively have to turn off error handling, send your email, stop your strategy through your code. Note that turning off error handling can be very dangerous if you have not programmed your strategy to handle error cases.

          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Thanks for the replies guys,

            Is NinjaTrader "guaranteeing" to call Dispose method when the strategy is stopped due to whatever reason? As far as I know Dispose is only called when a .NET object is dereferenced.

            A preferable solution would be to have an overwriteable event method that is called whenever a strategy is stopped, with the reason for the stop as parameter. Does such a method exist?

            Thanks again,
            dax3k

            Comment


              #7
              We will have to get back to you if Dispose() is guaranteed or not.

              Unfortunately there is no method for when a strategy is stopped.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Thank you very much Josh, awaiting for you reply on this.

                This issue occurred last night and a position from the strategy was still open in the morning. It is essential to have some form of notification when the strategy turns OFF.

                Thanks again,
                dax3k

                Comment


                  #9
                  dax3k,

                  As a strategy runs into a problem it should terminate itself while closing all open positions and cancelling all working orders. Not sure why you may have had a remaining open position.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Josh,

                    I opened a new thread with a snapshot of a live trade describing the situation exactly.

                    You can see why I'm in a desperate need of a notification function for whenever a strategy turns off. This is absolutely critical.

                    Here's the link:


                    Thanks for all your help on this matter,
                    dax3k

                    Comment


                      #11
                      dax3k,

                      NinjaTrader does not guarantee Dispose() from an order error.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        hi, is there a simpler method these days to receive an email when the strategy stops? Does Ninja send that information if I enable "email log alert messages to"? thanks

                        Comment


                          #13
                          Hello rocker84,

                          The option from the options menu would send any and all alerts type messages. That would be if you wanted to keep updated with what the platform was doing with everything including strategies with alerts. For a single strategy and finding if it was having a problem with orders what was outlined here would still be the most simple way to do that or to turn off rejections so you can observe the event.

                          I look forward to being of further assistance.
                          Last edited by NinjaTrader_Jesse; 03-10-2021, 02:12 PM.
                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Christopher_R, Today, 12:29 AM
                          0 responses
                          9 views
                          0 likes
                          Last Post Christopher_R  
                          Started by sidlercom80, 10-28-2023, 08:49 AM
                          166 responses
                          2,235 views
                          0 likes
                          Last Post sidlercom80  
                          Started by thread, Yesterday, 11:58 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post thread
                          by thread
                           
                          Started by jclose, Yesterday, 09:37 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jclose
                          by jclose
                           
                          Started by WeyldFalcon, 08-07-2020, 06:13 AM
                          10 responses
                          1,415 views
                          0 likes
                          Last Post Traderontheroad  
                          Working...
                          X