Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent strategy from disabling when there is an error?

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

    Prevent strategy from disabling when there is an error?

    Hello,

    I was wondering if there is any way to prevent a strategy from disabling itself when there is an error. I had an overfill error on a strategy last night while I was asleep and so of course it disabled the entire strategy -- I would like to know if there is a workaround or feature I can use to prevent the strategy from disabling when this happens, and to keep running anyway.

    Regards,

    Andrew

    #2
    Hello LightWeight,

    Thank you for your inquiry.

    You would want to have IgnoreOverFill set to true in your intialize method as shown below:

    protected override void Initialize()
    {
    // Allows for custom overfill handling
    IgnoreOverFill = true;
    }
    Please, be advised that doing this can have serious adverse affects on a running strategy unless you have programmed your own overfill handling. Overfill handling should only be addressed by experienced programmers.

    For more information about IgnoreOverFill, please take a look at the NinjaTrader help guide at this link: http://www.ninjatrader.com/support/h...reoverfill.htm

    The help guide also include a very handy alphabetical reference guide for NinjaScript as well: http://www.ninjatrader.com/support/h..._reference.htm

    Please, let us know if we can be of further assistance!
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Strategy Disabled Alert

      following on from this is there a function that detects when a strategy is disabled and sends an email via sendmail() ? Regards and thx

      Comment


        #4
        Hello everington_f,

        Thank you for your inquiry.

        You would be able to use the OnTermination() method to place your SendMail() into to send an email when your strategy is shutting down.

        Example:
        Code:
        protected override void OnTermination() 
        {
             SendMail(....);
        }
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Ok that will work... but will upon termination will only one email be sent or will I get multiple copies?
          Regards and thx

          Comment


            #6
            Hello everington_f,

            As long as you have only one SendMail() call in OnTermination(), it will only send one email. OnTermination() is only called once.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by trilliantrader, 04-18-2024, 08:16 AM
            4 responses
            18 views
            0 likes
            Last Post trilliantrader  
            Started by mgco4you, Today, 09:46 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by wzgy0920, Today, 09:53 PM
            0 responses
            9 views
            0 likes
            Last Post wzgy0920  
            Started by Rapine Heihei, Today, 08:19 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 08:25 PM
            0 responses
            10 views
            0 likes
            Last Post Rapine Heihei  
            Working...
            X