Announcement

Collapse
No announcement yet.

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.

      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.

          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.

                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.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  579 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  334 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  554 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  551 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X