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 GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,227 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            7 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            440 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            12 views
            0 likes
            Last Post FAQtrader  
            Working...
            X