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

How to efficiently remove Properties

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

    How to efficiently remove Properties

    with NT7 I could simply remove a Property group and the input control in the input control panel would be removed when the code was saved. I did not need to edit any of the NinjaScript generated code sections, it was updated on the save.


    How do I do this with NT8? when I delete an input control item, the NinjaScript generated code still contains the related variables.

    #2
    Originally posted by tulanch View Post
    with NT7 I could simply remove a Property group and the input control in the input control panel would be removed when the code was saved. I did not need to edit any of the NinjaScript generated code sections, it was updated on the save.
    Hello tulanch,

    Thank you for your post.

    This should be the same process in NinjaTrader 8. You may wish to create a new NinjaScript object and place the code (without the NinjaScript generated code) in the new file, delete the old file and compile.

    Please let me know if you still have problems with the NinjaScript generated code.

    Comment


      #3
      I understand what you are saying, but I recall NT7 doing a different way as well.

      I recall I could simply remove the definition from within the

      #region Properties

      area, save the code, and then recompile. NT7 would remove the required code from the

      #region NinjaScript generated code. Neither change nor remove

      area. This was the same for Plots and Lines.


      It definitely does not work this way in NT8.

      Comment


        #4
        Yes, that is REALLY ANNOYING, eh!

        There seems to be a bug in the way the auxiliary code is auto-generated, but it can be circumvented.
        1. Comment out the line containing NinjascriptProperty enclosed by brackets. A line like this:
          Code:
          [Range(1, int.MaxValue), NinjaScriptProperty]
        2. Compile the script.
        3. Comment out the remaining lines of the property group, and any remaining usages of the unwanted variable elsewhere in the code.
        4. If the script compiles successfully you can now delete the commented lines.


        Is there anyone who knows why this works? I don't, but it does.

        Note: In NT7 there was a similar problem that only affected Enums.
        Last edited by Ricam; 02-14-2017, 02:20 PM.

        Comment


          #5
          Hello tulanch and Ricam,

          I agree, this should not be occurring at all. The behavior I see is akin to NinjaTrader 7.

          Please advise what versions of NinjaTrader 8 are you running under Help > About?

          In addition, do you have an example of this I may test on my end? You can export your indicator by going to Tools > Export > NinjaScript Add On > Add > select your indicator > OK > Export > name the file 'NTsupport' > Save.

          The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

          I look forward to your response.

          Comment


            #6
            I don't have any examples, and not sure how to make one. Currently using latest version of NT8 but haven't run into this lately, it happened a few times in the past with older versions, and the workaround I mentioned did work.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            4 responses
            543 views
            0 likes
            Last Post PaulMohn  
            Started by GLFX005, Today, 03:23 AM
            0 responses
            3 views
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            12 views
            0 likes
            Last Post XXtrader  
            Started by Waxavi, Today, 02:10 AM
            0 responses
            7 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            14 views
            0 likes
            Last Post TradeForge  
            Working...
            X