Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Disabling to edit strategy renders it unable to re-enable.

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

    Disabling to edit strategy renders it unable to re-enable.

    I've had this issue since I've begun and assumed it to be an inherit issue within NT but since I've stumbled through all other outstanding issues and am running a production environment, I thought I'd ask:

    I've never been able to edit a strategy once I've enabled. The only option i have is to delete the strategy, add a new, rebuild parameters and enable (initialize).

    Have you heard of this happening due to particular scripting issues? It renders no errors between initialization and disabling but will never allow the disabled strategy to be re-enabled after.

    As usual, thank you.

    LM

    #2
    Hello larkmail,

    Thank you for your reply.

    As this is specifically in regards to coding NinjaScript strategies, I've moved this to the appropriate forum.

    It would be expected that if you disable the strategy on a chart, and edit the strategy code that you would need to completely remove the strategy from the chart, set the parameters and enable it again in order to see all changes to the strategy, especially when changes are made in the OnStateChange() method. It would be best practice to do this each time rather than simply re-enabling or reloading NinjaScript as the strategy implementation may have changed (for example, parameters may have changed).

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Ahh. I use strategies strictly within the tab on the console but, with that said, I may be touching (modifying) the file each time between disable/enabling. Will check and follow up if necessary.
      Much appreciated,

      LM

      Comment


        #4
        emphasizing that i strictly use strategies within the console tab and not within charts:

        I ran some tests today and it looks to be relative to whether the strategy is starting from a quantity adopted position (i.e. existing quantity) or none (i.e. no quantity). I am using the "adoption" method since i start/stop active strategies and have varied quantity changes that may have occurred via manual entries.

        Logs show no errors and correctly show all events up to the disabling of the strategy but, once disabled, renders no effect/error while attempting to enable. It's as though "enable" no longer functions.

        It's at this point, i "remove" the strategy, re-add and configure and then successfully enable again (only once).

        Comment


          #5
          Hello larkmail,

          Thank you for your reply.

          When this occurs, do you have the open position protected by any active orders on the account? I've been able to replicate this when there is an active unfilled order, for example, a target or stop on the same instrument and account. What I see occur when this is the case is that the strategy will not enable. If you put the same strategy on a chart with a position that's protected by a target or stop and attempt to enable it, you will receive an error message that the strategy cannot be enabled while there are active orders on the account and the strategy will be automatically disabled. I believe you should also be getting this message when trying to enable the strategy on the Strategies tab when there are active orders, so I will be reaching out to our QA team to see if they can look into why it's not being displayed.

          So, in a nutshell, check the account for any active, unfilled orders and cancel those before attempting to start the strategy and it should enable for you.

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            I've spent a little time enabling/disabling to test various scenarios but no luck defining anything specific.
            I CAN only get an error to generate if the following is true:
            • Startup of NT
            • Instrument strategy is left disabled
            • Instrument has order or orders placed manually (via TOS)
            • Instrument is in a flat state (own no shares due to completed manual trades in TOS)
            • Attempt to enable strategy and the following error renders:
              • "could not be enabled because the 'Start behavior' parameter 'Adopt account position' requires that it be the only strategy running on this instrument(s) in *************. Please disable other strategies running on the same account-instrument combo(s) first to be able to enable your strategy."
            Again, the strategy was never enabled from the beginning yet is treated as though it was currently enabled.

            Other than that, I can NOT produce an error yet (and the biggest pain) if i disable a strategy to make changes i can no longer enable. This forces me to "remove" and rebuild the strategy as a new.
            If i'm simply disabling different strategies due to the need for them to be turned off, I can shutdown NT and restart which allows me to immediately enable all saved (and previously disabled) strategies straight away with no issues.

            Anywhere else i should look for potential insight?

            Comment


              #7
              The simplest example i can give is to startup NT, enable a strategy, disable the same strategy and that's all you can do. It must be removed, at that point regardless of the instrument state (owned or not owned).

              Comment


                #8
                Hello larkmail,

                Thank you for your reply.

                Can you provide a basic example strategy that illustrates this that we can test with? I'm only able to hit the scenario where the strategy will not let you re-enable it when there are existing orders on the account.

                As far as the other error, can you confirm that the account was flat and no other strategy was actively applied to the same instrument and account when trying to enable the strategy?

                Thanks in advance; I look forward to assisting you further.
                Kate W.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ageeholdings, Today, 07:43 AM
                0 responses
                7 views
                0 likes
                Last Post ageeholdings  
                Started by pibrew, Today, 06:37 AM
                0 responses
                4 views
                0 likes
                Last Post pibrew
                by pibrew
                 
                Started by rbeckmann05, Yesterday, 06:48 PM
                1 response
                14 views
                0 likes
                Last Post bltdavid  
                Started by llanqui, Today, 03:53 AM
                0 responses
                6 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by burtoninlondon, Today, 12:38 AM
                0 responses
                12 views
                0 likes
                Last Post burtoninlondon  
                Working...
                X