• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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. :
    http://ninjatrader.com/support/forum...ead.php?t=3475
    http://ninjatrader.com/support/forum...ead.php?t=3476

    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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hanstanz, Today, 04:44 AM
        0 responses
        9 views
        0 likes
        Last Post Hanstanz  
        Started by juniortut, Today, 04:38 AM
        0 responses
        5 views
        0 likes
        Last Post juniortut  
        Started by rojiinko, Today, 03:58 AM
        0 responses
        4 views
        0 likes
        Last Post rojiinko  
        Started by mreanuzlazx, Today, 01:30 AM
        0 responses
        4 views
        0 likes
        Last Post mreanuzlazx  
        Started by xinepev, Today, 12:33 AM
        0 responses
        4 views
        0 likes
        Last Post xinepev
        by xinepev
         
        Working...
        X