Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to save/load indicator parameters?

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

    How to save/load indicator parameters?

    Has anyone come up with a way to save/load indicator and strategy parameters? If I have a complex indicator with several combinations of parameters I want to use, I would like to save those combinations somehow and be able to restore them into the indicator so I don't have to manually change each parameter. Is this possible?

    Thanks!
    Bryan

    #2
    Hello,

    You will need to alter the code within the indicator/strategy: Tools>Edit>Indicator>select the indicator>OK>right click Save as and save the indicator under a different name>double click the word Variables near the top of the code>change the value to the right of the "=" sign that corresponds with your input parameter>right click>Compile>Close the indicator code by clicking on the x in the right hand corner.

    You will need to do this for each parameter setting you want to save.
    DenNinjaTrader Customer Service

    Comment


      #3
      Basically if you want saved parameters you will need to change the default parameters for the NinjaScript. There is no "loading" of parameters. What Ben is suggesting is you can create yourself several instances of the same NinjaScript with varying parameter loadouts. That will allow you to pick and choose which one you want to use at which point in time.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Josh View Post
        Basically if you want saved parameters you will need to change the default parameters for the NinjaScript. There is no "loading" of parameters. What Ben is suggesting is you can create yourself several instances of the same NinjaScript with varying parameter loadouts. That will allow you to pick and choose which one you want to use at which point in time.
        OK thanks... yes, I don't want 10 different variations of the same indicator code. I just want one indicator and several parameter files to load into it. OK, we'll work something out, thanks!

        Bryan

        Comment


          #5
          Originally posted by cassb View Post
          OK thanks... yes, I don't want 10 different variations of the same indicator code. I just want one indicator and several parameter files to load into it. OK, we'll work something out, thanks!

          Bryan

          Hi Bryan,

          you could save your parameters to a file and read it back from that file. There are some official code examples available how to use stream - read/write. The save location for writing to a file is the dispose-method, and for reading from that file the first time OnBarUpdate() is called. If this is to late you could also read at Initialize(). Be aware, Initialize() could be invoked several times, because your indicator could be instantiated several times, before the one appears which is starting OnBarUpdate().

          If you are an experienced programer you could try to expand the context menu for save/load configuration.

          Regards
          Ralph

          Comment


            #6
            Hi cassb,
            You could also create different chart templates for the indicators and settings...

            Comment

            Latest Posts

            Collapse

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