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

Indicator not properly restored when new enum value added to enum input

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

    Indicator not properly restored when new enum value added to enum input

    If I have an indicator that uses an enum as an input, and then add a new enum value, any instances of that indicator do not retain the values for said input, and instead reset to the default value.

    First is this a known issue?

    Second, seeing as this is just an int value, can this be serialized in/out as an int value vs an enum?

    #2
    I tried serializing similar to a brush, by converting enum to int to string and back again, but this did not solve the issue.

    Comment


      #3
      Hello aslane,

      Thank you for the post.

      I tried a quick test using an indicator template but was unable to see the problem. Can you provide the specific steps you are using along with an example of how you defined the enum in your script/where it was defined in the script?.

      Also what changes are you making to the enum, are you adding a new value to the end of the enum or somewhere in the middle to where it would change the order?


      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Attached is a simple dummy example with a single input that shows the issue.

        The enum is declared in the global namespace. Each enum entry has a specific value defined, including an ending value that will always be at the end.

        Once placed on a chart, change the AvgType input to EMA (which is not the default value set in SetDefaults). You can save workspace at this point.

        Now, the following causes the issue:

        1. Add new enum value (I have one commented that can be added)
        2. Compile the ind
        3. Go to chart and hit F5 to reload NS

        At this point the input is reset to the default value instead of maintaining its current value.

        If you now close the workspace without saving and then reload workspace that was previously saved, it will have the correct value restored.

        EnumIssue.cs

        Comment


          #5
          Hello aslane,

          Thank you for providing the sample.

          I was able to see the change with this sample, I will need to research this further to see if this would be expected or something I can report. Once I have more details I will provide an update here.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            One item I forgot to mention is that it does not matter if the input is a NinjaScriptProperty or not.

            Comment


              #7
              Any update?

              Comment


                #8
                Hello aslane,

                Not at this time, if I have anything additional that I can provide I will update the thread.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Hello,

                  I just wanted to provide an update, this item has been logged with development and can be tracked using the ID: NTEIGHT-14346.

                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,403 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by Shai Samuel, 07-02-2022, 02:46 PM
                  4 responses
                  94 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by DJ888, Yesterday, 10:57 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  158 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Yesterday, 09:29 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post Belfortbucks  
                  Working...
                  X