Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Properties not saving into Templates

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

    Indicator Properties not saving into Templates

    I am having a problem figuring out how to get indicator parameters to be saved in templates. I noticed recently that several saves, when reloaded, returned to the default values in the coding. Some work, some don't but I can't see any difference in the Properties Menu coding which I assume is where the problem lies. I also can't find anything in the Help Menus or the forum about this, though I suspect it is all there somewhere.

    For I example, I have the following in a Properties Menu:

    //[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
    [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
    [Gui.Design.DisplayName ("LR Bars")]
    [Description("LR PaintBars Option")]
    [Category("Parameters")]
    public bool LRBars
    {
    get { return lRBars; }
    set { lRBars = value;}
    }
    This will not save into a template unless I remove the XML ignore line, but the comments following that line - which I got from somewhere and see in many indicators, seem to be saying that you should have XML ignore if you want it saveable.

    Is there something else going on with all this that I have not twigged to yet?

    More importantly: is it true - as it appears - that any time I add in the XML ignore line that I will not be able to save various different parameters for that element in various different templates?

    Or why can I save into templates when I remove that line?

    What is the meaning of XML ignore anyway?

    #2
    Additional question on related issue:

    I often make new indicators from previous ones at which point there can be a few plots or other things like booleans, ints etc. that I don't need anymore.

    1. If they are still there in the code, how can I get a plot not to display in the Indicator Menu. I have tried using Browsable(false) but it still comes up.

    2. Some parameters are saved in the lower section after Properties and when I try to remove them after taking them out of the variable and Properties menu, they just keep coming back. The only way I have found to clean them out is to copy the code to a new indicator and before verifying it go through the code line by line to get rid of all references to the offending item and then, when verifying for the first time, it seems to work. Is there a simpler way of getting rid of these elements?

    Comment


      #3
      cclsys,

      Depends what kind of parameter types you are making. Make sure you follow exactly how it is shown in something like the SMA indicator.

      1. If you don't want it to show you need to delete it and all relevant portions from your code.

      2. You should NEVER touch code marked at the bottom in the "Do not change or delete" section.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Josh View Post
        cclsys,

        Depends what kind of parameter types you are making. Make sure you follow exactly how it is shown in something like the SMA indicator.

        1. If you don't want it to show you need to delete it and all relevant portions from your code.

        2. You should NEVER touch code marked at the bottom in the "Do not change or delete" section.
        Thanks, but to clarify further:

        am I right that the comment after the XML ignore says the opposite of what it should, i.e. that if you DO have XML ignore it will NOT be saved in templates, but if you DON'T have XML ignore it CAN be saved in templates?

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          cclsys,

          Depends what kind of parameter types you are making. Make sure you follow exactly how it is shown in something like the SMA indicator.

          1. If you don't want it to show you need to delete it and all relevant portions from your code.

          2. You should NEVER touch code marked at the bottom in the "Do not change or delete" section.

          To clarify further: what do you mean by ' depends on what kind of parameter types you are making'?

          Comment


            #6
            Not sure where you copied that line from to begin with. If you look at default system indicators they do not use that line so you don't need it for the most part. Could be certain situations where an advanced programmer may use it, but that is beyond the level of support I can offer.

            If you are making parameters of types like double, int, bool. You will be fine. If you are making types like Color then you will need to do some additional steps.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              Not sure where you copied that line from to begin with. If you look at default system indicators they do not use that line so you don't need it for the most part. Could be certain situations where an advanced programmer may use it, but that is beyond the level of support I can offer.

              If you are making parameters of types like double, int, bool. You will be fine. If you are making types like Color then you will need to do some additional steps.
              OK, I am going to take that as meaning that the comments attached to XMLignore are incorrect. I have seen them on many indicators, including ones by Roonius who seems to know what he is doing. But it seems to me that the comment is phrased incorrectly to mean the opposite of what it should.

              Thanks anyway.

              Comment

              Latest Posts

              Collapse

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