Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Save Settings For Startegy Not Working

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

    Save Settings For Startegy Not Working

    Hi,

    I have several strategies developed with NT8 and natuarally I would like to save different settings on file so that I don't have them to type them every time I do a backtest.
    On paper, it looks to be easy enough to do as in the setting template from Strategy Analyzer you simply go to "Template > Save" and then type a name for the configuration (same as fig. setting1.jpg).
    However, whenever I do that, the setting file that is saved is always empty (settings2.jpg) and, therefore, no setting is effectively saved. I don't really understand what I am doing wrong since it looks like basic.

    Could you be able to tel me whether this is a known issue? It is quite annoying for me having to type new settings every time.

    best regards
    Marco B


    Attached Files

    #2
    Hello marcobar975,

    Thanks for your post.

    I see that you do have other templates that do appear to have information (based on their size).

    Please repeat a test using the strategy SampleMACrossOver and advise if you still see empty templates.

    If you are seeing templates saved as you set them with SampleMACrossover but not with your strategy that suggests there may be an issue with your custom strategy. Please check the "Log" tab of the control center for any related error messages that may provide further information when you try to save your templates.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul,

      I tried with SampleMACrossover and it looks fine, it can save a new configuration and load it again which the new parameters.
      The other files that you see in my custom strategy folder still have only partial information (but now I don't even get that) so it doesn't help.
      I checked the "Log" tab but nothing is printed out when I try to save the template.

      If the issue is specific to my custom strategy parameters I am not sure what can really go wrong in saving some specs? (The strategy works fine).
      Any other way I can debug this issue?

      best
      Marco

      Comment


        #4
        Hello marcobar975,

        Thanks for your reply.

        Outside of the strategy analyzer, for example on a chart, are you able to create a template and save/load that template of your strategy?

        Please observe the log tab for any errors when testing this.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi Paul,

          I uploaded the strategy to the "Strategy" tab and when I save the configuration from there I get the following error in the logs (attached). Not sure what it means.
          This time the Saved configuration fiile is not completely empty but still missing most of te fields.

          Thanks
          Marco
          Attached Files

          Comment


            #6
            Hello marcobar975,

            Thanks for your reply.

            So the error is advising that you cannot XML serialize a dictionary

            You could make it a private dictionary or attempt to convert it to a serializable type such as we do with brushes. https://ninjatrader.com/support/help...definedbrushes

            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi Paul,
              thanks for the answer. I will try that.

              Best
              Marco

              Comment


                #8
                Hi Paul,

                actually I am a bit puzzled. All the UI parameters that I define are strings and all the dictionaries I have defined in the code are already defined as private.
                I also tried to remove every parameters I define from teh UI and hardcode them and the result is teh same. So, if I understand correctely, the crash in the XML output is not due to the parametrers settings but something else in the code...this is where I get confused I guess.
                Is that possible?

                thanks
                Marco

                Comment


                  #9
                  Hello marcobar975,

                  Thanks for your reply.

                  Can you provide a reduced code example (of just 1 property) that produces the initial issue you reported?
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Paul,

                    this is the main file, I attached as it is. It is actually a container of strategies so there is not really any sensible information here.
                    Let me knwo if you need more info.

                    Best
                    Marco
                    Attached Files

                    Comment


                      #11
                      Hello marcobar975,

                      Thanks for your reply.

                      Can you confirm that your strategy does function when applied to a chart or to the strategies tab?
                      Paul H.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Paul,

                        I mainly used the strategy with Strategy Analyzer for Backtest and it works.

                        best
                        Marco

                        Comment


                          #13
                          hello marcobar975,

                          Thanks for your reply.

                          The strategy you provided does not compile and is missing some components.

                          Please provide a simple, small reduce code example that demonstrates the issue so we can focus on the issue and not debugging your complete code.
                          Paul H.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Paul,

                            these should be are all the files you need to compile.

                            StrategyBase.cs, PortfolioEcecutor.cs, SimpleEMACrossover.cs and DoubleBB.cs are strategy files. The base strategy that fails to save is PortfolioExecutor.cs (which is not a strategy per se). In the other files, where the actually strategies are, I delete all the sensitive methids and I include them here to you just to make it easy to compile.

                            In the next posts I will attach other utility files are utility classes which you need in order to compile. I cannot add all together because of the post restrictions on number of files.

                            There is also one library which you need to include and which I could not upload because the dll's size was too big (1M). However, the librarry is the following and you can download it from here

                            https://numerics.mathdotnet.com/

                            Thanks very much for your help

                            best
                            Marco




                            Attached Files

                            Comment


                              #15
                              Hi Paul,

                              these are the files I was mentioning in the previousli mentioning and that I used to keep in the Indicators directory.
                              NOTE: please change the extension .txt -> .rar

                              best
                              Marco
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ebaydan777, Today, 02:41 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ChrisL  
                              Started by aligator, Today, 02:28 PM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Started by daniel_weber8, Today, 01:21 PM
                              1 response
                              21 views
                              0 likes
                              Last Post NinjaTrader_ChristopherS  
                              Started by jungsoohuh, Today, 12:07 PM
                              1 response
                              28 views
                              0 likes
                              Last Post NinjaTrader_PaulH  
                              Started by SharonSS, Today, 11:54 AM
                              2 responses
                              24 views
                              0 likes
                              Last Post SharonSS  
                              Working...
                              X