Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Saving strategy settings ...

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

    Saving strategy settings ...

    I have a custom strategy with many settings, and these settings differ depending on the instrument the strategy is run on. When I want to enable the strategy on a new chart, I have to go through the error-prone task of setting each setting to its correct value for that instrument...

    Is there an open-source code snippet available that will allow me to save the settings for a given instrument? So that I can simply load say "SPY settings" next time I want to run the strategy on a new SPY chart...

    Thanks.

    #2
    Hello,

    Thank you for the question.

    By default a strategy can have one set of defaults by right clicking in its properties and setting those settings as default.

    You could load data based on a Property you set in the strategy. For example if you have a String input, you could type in the name of the file and it could load that file and apply settings.

    There is no complete sample of this process, but you could use the following example of Writing data to file and Reading data from file to accomplish this type of task. :



    You could also look into using Serialization and Deserialization to save structured data like an object to an xml file and then restore that data. This is not a topic NinjaTrader support could assist with but instead would be a general C# concept you could research.

    I look forward to being of further assistance.

    Comment


      #3
      Saving Strategy Settings

      Originally posted by AnotherTrader View Post
      I have a custom strategy with many settings, and these settings differ depending on the instrument the strategy is run on. When I want to enable the strategy on a new chart, I have to go through the error-prone task of setting each setting to its correct value for that instrument...

      Is there an open-source code snippet available that will allow me to save the settings for a given instrument? So that I can simply load say "SPY settings" next time I want to run the strategy on a new SPY chart...

      Thanks.
      Can someone from NT Support respond to this? Thanks.

      Comment


        #4
        Hello,

        Thank you for the post.

        The post #2 in this thread was the reply to the original posters question from our support. Unfortunately, there is nothing I could provide in addition to the previous answer.

        The platform is only capable of storing 1 Default settings template for each script. If this is too limited, you would need to design your own save/load system for additional templates that are built into your custom item. This is a concept that we do not have any samples of so there would not be anything more I could provide on this subject.

        Post #2 highlights some possible ways you could accomplish a save/load system from a custom item.

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 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
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X