Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IsAdoptAccountPositionAware not working RC1

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

    IsAdoptAccountPositionAware not working RC1

    Documentation says that putting
    Code:
    IsAdoptAccountPositionAware = true;
    into State.SetDefaults
    Once set to true, your strategy's "Start behavior" options will include an additional parameter named "Adopt account position"
    I put this in one of my strategies, recompiled, re-added strategy, restarted NT. None of these caused the extra option "Adopt account position" to appear.
    So is there something else that needs to be set to get this option?
    Perhaps
    Code:
     IsUnmanaged = true;
    ?

    #2
    Hello DaveE, and thank you for your question.

    I wasn't quite seeing the same thing you were describing on my end, and so I made a short video going over the steps I take to get the Adopt Account Position option to appear for me. Would it be possible for you to review this video? If I did anything differently, or any other questions come up, please let us know and we will be happy to assist further.

    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hello Jessica,
      Thanks for the video. You are right that a brand new strategy with IsAdoptAccountPositionAware = true;
      works as documented.

      I tried saving my strategy (Strat1) as another name (no code changes) Test1. When I loaded Test1 yes "Adopt account position"is now in the options. But the NT strategies facility (whether from Charts, or Strategies tab) stubbornly refuses the option for Strat1.
      Even though the code is exactly the same (except for name).
      I assume this is because NT strategies facility has cached some information about available options from previous runs of Strat1, and has forgotten to update its cache.

      I thought I could work-around this as follows:
      Delete Strat1, save Test1 as Strat1, compile.
      Now when I try to add these strategies, Test1 gives me the "Adopt account position" as expected, but Strat1 still refuses.
      Conclusion: Even though I deleted Strat1, NT8 RC1 still seems to have retained some outdated option information about it (could this be something to do with templates), so when I recreated with the same name it still refuses to give me the option!

      I am afraid I am unable to duplicate this problem starting from a brand new strategy. As a workaround I will be adding IsAdoptAccountPositionAware = true;
      to my new strategies before enabling them.

      Comment


        #4
        Thank you for this additional information. Would it be possible to ask you to repeat this with two basic "hello world" strategies (really 1 copied into 2 files) and then attach both strategy C# files to a reply here on the forums? This will make it easier for us to reproduce this behavior on our end.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          I found the problem:
          The strategy had a template called Default which I had created before adding
          IsAdoptAccountPositionAware = true;
          to the code.

          In the template was the line
          <IsAdoptAccountPositionAware>false</IsAdoptAccountPositionAware>

          I deleted this template from the folder. Re-added Strat1 and now the option "Adopt account position" is available.

          I can only assume that the current strategy facility incorrectly assumes this line (which I never explicitly set) from the old template overrides the current code setting
          IsAdoptAccountPositionAware = true;

          Comment


            #6
            I am glad that you were able to find a solution to your query. Is the template simple enough to be shareable on the forums? If so, I would be happy to try to reproduce what you were seeing and pass this information on to the product management teams so that they can review Ninja's behavior.

            If there are any other ways we can help please let us know.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              I my opinion the problem is caused by poor design of strategy template functionality. Here's the info to pass to development:
              1) The next release of NT should not save this line to the strategy's template:
              Code:
              <IsAdoptAccountPositionAware>false</IsAdoptAccountPositionAware>
              Reason user has not requested this setting.

              2) The next release of NT should ignore this line if found in an old strategy template (stop overriding the current setting in strategy code for IsAdoptAccountPositionAware).

              3) The next release of NT should make strategy deletion cleaner as follows:
              If user requests deletion of say Strat1 then the deletion process should also delete any strategy templates under the folder with the same name (here ...NinjaTrader8\templates\strategy\Strat1 )
              (at minimum delete any Default template).
              Reason: failure to delete the Default template causes weird 'zombie' behavior if the strategy name is later re-used.

              Comment


                #8
                Thank you for this information. I understand that code can sometimes be sensitive and why you would not desire to share it in a web forum. Could you provide me instead with a set of steps I could use to cause IsAdoptAccountPositionAware to be in a stuck state? The development team will need this information to properly modify the template.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  Sorry I cant afford to spend more time on this bug. It should be up to NT's paid testing team to come up with test sequences. All I can say is that this line in the Default template was stuck at
                  <IsAdoptAccountPositionAware>false</IsAdoptAccountPositionAware>

                  and I cant see why this line should be in the template anyway.

                  Comment


                    #10
                    Thank you once again for your report and for the help you have already given.
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello, and thank you for your report. This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.



                      Jessica P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Barry Milan, Yesterday, 10:35 PM
                      7 responses
                      19 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by AttiM, 02-14-2024, 05:20 PM
                      10 responses
                      179 views
                      0 likes
                      Last Post jeronymite  
                      Started by ghoul, Today, 06:02 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post ghoul
                      by ghoul
                       
                      Started by DanielSanMartin, Yesterday, 02:37 PM
                      2 responses
                      13 views
                      0 likes
                      Last Post DanielSanMartin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      4 responses
                      13 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Working...
                      X