Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy Builder help

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

    #16
    Paul,

    In the absence of a solution from TopDog, I continue to pursue my solutions from different angles. I am stumped however by some indicator solutions and Optimization. I have watched quite a few videos and looked through the support guide but I am sure I am missing something. Perhaps it is due to my ignorance about programming. Keep in mind I am using the Strategy Builder.

    For the indicators, I have no problem with a situation where I call out for example, a SMA50 crossing over a SMA200. But when I attempt to set a condition whereas the indicator line I am measuring crosses a certain numerical value, I get errors in my code. My setting is attached. Click image for larger version

Name:	Aroon Down.png
Views:	235
Size:	188.3 KB
ID:	1115878

    For Optimization, I would like to test different bar types, sizes and time frames. Do I need to set these up in the 'Default Properties', 'Additional Data', 'Inputs and Variables' or a combination of all 3?

    If there are videos that you feel would be helpful, please advise.

    Thanks,

    Dolfan

    Comment


      #17
      Hello Dolfan,

      Thanks for your reply.

      In your example screenshot you have created the condition of is the Aroon indicators' "Down" plot greater than the numeric value of 90? I don't see anything wrong with that assuming that is what you want. What specific errors do you see or do you mean that it is performing incorrectly? In the latter case have you selected the correct plot? (Should it be the "Up" plot?).

      In the strategy analyzer optimizer, you can optimize most parameters you have created as user input. So if you want to optimize on something, create it as a user input. Please give consideration to the default and MIN values as once created you cannot change these without first removing them from the conditions.

      You can optimize a data series by checking "Optimize data series" which will only allow you to specify the bar sizes. To optimize on bar type you would have to manually switch to a different bar type.

      Paul H.NinjaTrader Customer Service

      Comment


        #18
        Paul,

        I'll have to get back to you on the Aroon error. I seemed to have lost it when compiling something else.

        As for the Optimization, TopDog indicators are based on the precipice of a 1:3 chart comparison. For example if you are looking at a 5 minute chart, you would get a confirmation from a 15 minute chart. If you are using a 100 tick chart, you would get confirmation from a 300 tick chart. If you are using a Renko 5 chart, you would get confirmation from a Renko 15 chart. And so on.... TopDog does not recommend which type charts to use, only that you use the 1:3 comparison for confirmation of trade setups. This is where Optimization comes in. It is my desire to test the same strategy on different types of charts and with various size settings to find the optimal 1:3 ratio setup. So....

        How best to set this up? Do I put all of the types that I want to test in the Input and Variables section and select the types that I want to test individually? For example if I am looking at Renko bars, the optimizer would test all size bars I have input? If I want to test Minute bars, the optimizer would test all time frames I have input?

        Dolfan

        Comment


          #19
          Hello Dolfan,

          Thanks for your reply.

          If I understand correctly you are saying that you intend to enter on one time frame but need a confirmation signal based on a 3x higher time frame?

          As I have no knowledge of the 3rd party indicator I would not be able to advise specifically.

          We do not recommend dynamic data series assignment and this would not be supported in the strategy builder specifically so I am unsure how you would accomplish your goal of optimizing over x different bars, time frames. I would think you are going to have to approach this manually assuming you can use the 3rd party indicator in the strategy builder and can use it on the higher time frame.

          Just to clarify, you are able to add other type frames and other (limited) bar types as secondary series in the strategy builder. To give you a general idea, please see this short video: https://paul-ninjatrader.tinytake.co...MF8xMTY0NTQyMw
          Paul H.NinjaTrader Customer Service

          Comment


            #20
            Thanks for the video Paul, I think this will help in some ways but I am not seeing what I believe I am looking for here. Perhaps I am not looking at it correctly? What I have seen in Optimization videos is the opportunity to select an input, give it a starting point, an end point and an interval that it will scan through that range to test different ranges. The video here https://www.youtube.com/watch?v=SxbGhhkKtXk from Ninjatrader illustrates this with am SMA strategy. Can I use this in the same manner to test minutes, then ticks, then Renko bars (range bars as it is)? If I am not able to test in this manner, does this mean that I am going to have to test each bar type and size individually? Is there any way to use the optimizer to broaden the test?

            Dolfan

            Comment


              #21
              Hello Dolfan,

              Thanks for your reply.

              The optimizer cannot optimize on different bar types, so yes you would have run each bar type separately

              The optimizer can test various time frames of the same bar type.

              Note if your strategy includes an added time frame, (which is what my video shows) the optimizer would not be able to optimize the added data series. (In other words, there are no means to automatically increase the added data series 3x on each iteration).



              Paul H.NinjaTrader Customer Service

              Comment


                #22
                OK, so I think I am getting closer to an understanding here. Correct me if I am wrong. If I choose minute bars then I can give it a range of 5 to 60 minutes and an interval of 5 minutes. This will give me 11-12 iterations. The same can be done for tick and range bars. But how do I best set this up? Is it in the Additional Data or the Inputs and Variables? Currently I have it in Additional Data and it returns this code...

                AddDataSeries(Data.BarsPeriodType.Minute, 5);
                AddDataSeries(Data.BarsPeriodType.Minute, 15);
                AddDataSeries(Data.BarsPeriodType.Minute, 60);
                AddDataSeries(Data.BarsPeriodType.Day, 1);
                AddDataSeries(Data.BarsPeriodType.Minute, 1);
                AddDataSeries(Data.BarsPeriodType.Range, 10);
                AddDataSeries(Data.BarsPeriodType.Tick, 100);
                AddDataSeries(Data.BarsPeriodType.Tick, 300);
                AddDataSeries(Data.BarsPeriodType.Tick, 1000);
                AddDataSeries(Data.BarsPeriodType.Tick, 3000);

                Will these return as Strategy Parameters that can be adjusted in the Strategy Analyzer?

                Dolfan

                Comment


                  #23
                  Hello Dolfan,

                  Thanks for your reply.

                  No, you would not need to add them to the Strategy Builder for optimization.

                  To optimize the Primary data series, in the optimizer, you need only check the box "Optimize data series", once checked a new field will show by the data series where you can set the start, end, and interval. Please see the attached.


                  Click image for larger version

Name:	dolfan-3.PNG
Views:	195
Size:	48.4 KB
ID:	1116002
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #24
                    This is EXACTLY where I get lost. Above where your drawing is highlighting the values that can be adjusted is the Strategy Parameters Fast and Slow parameters. Where do these come from because I have not been able to create these options in my strategies?

                    Dolfan

                    Comment


                      #25
                      Hello Dolfan,

                      Thanks for your reply.

                      In my screenshot I am using the SampleMACrossover. It has two "user inputs" called Fast and Slow that have the default values shown (10 & 25). These integer types are then used as the "period" for each moving average. So the user input make them available for optimizing however they have to be used in something in order for the optimization to be meaningful.
                      Paul H.NinjaTrader Customer Service

                      Comment


                        #26
                        Paul,

                        I got that but in order for them to appear in the optimizer they had to be set up somewhere in the strategy. Where and how does this occur and can it be done in the Strategy Builder?

                        I would also note that two of the strategies that can be tested are "Sample multi-time frame" and "Sample multi-instrument". When you try to run them as is, they return the same error I have been getting, "The strategy must have one or more parameter to optimize".

                        So I am back to square one here. Where in the Strategy Builder do I set up or put in parameters that the optimizer can use to test variations in my strategy?

                        Dolfan

                        Comment


                          #27
                          Hello Dolfan,

                          Thanks for your reply.

                          The Sample Multi-period has no parameters to optimize. The sample ATm strategy also has no parameters to optimize and the SampleATM strategy cannot be backtested as it uses an ATM strategy. So in summary the message would be expected in those two cases

                          I suggest that you start simply and build your understanding of the optimizer.

                          Start with the sample MA crossover. You can optimize the fast and / or the slow period. You can also optimize the data series.

                          As previously mentioned the Fast and Slow are user inputs that are then used as the Period for moving averages.

                          Once you see how optimizer works this will help you with your strategy.



                          As previously advised you do not need to add data series to be optimized on, you only need to check "Optimize data series" and then set them as you wish as shown in the screenshot in post 23

                          I do not know what parameters you want to optimize (other than bar type and time frame which have already been discussed)..

                          Paul H.NinjaTrader Customer Service

                          Comment


                            #28
                            Paul,

                            So according to this reply you are telling me to start with the "Sample MA crossover" which has the code unlocked. Therefore I cannot do this using the Strategy Builder. Am I reading this correctly?

                            Dolfan

                            Comment


                              #29
                              Hello Dolfan,

                              Thanks for your reply.

                              I am suggesting using a known strategy with 2 parameters so that you can successfully use the optimizer to better understand how the optimizer works.

                              I am not suggesting that it is a basis for your strategy builder strategy.

                              Paul H.NinjaTrader Customer Service

                              Comment


                                #30
                                We're spinning our wheels here Paul. You are suggesting that I use a "known strategy with 2 parameters", yet the only one KNOWN to me is the Sample MA crossover which is unlocked. This does not help me understand how to set up a strategy IN THE Strategy Builder WITH parameters that I can adjust in the Strategy Optimizer??? I feel lost in how I can explain this more clearly.

                                Dolfan

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by jaybedreamin, Today, 05:56 PM
                                0 responses
                                3 views
                                0 likes
                                Last Post jaybedreamin  
                                Started by DJ888, 04-16-2024, 06:09 PM
                                6 responses
                                18 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by Jon17, Today, 04:33 PM
                                0 responses
                                1 view
                                0 likes
                                Last Post Jon17
                                by Jon17
                                 
                                Started by Javierw.ok, Today, 04:12 PM
                                0 responses
                                6 views
                                0 likes
                                Last Post Javierw.ok  
                                Started by timmbbo, Today, 08:59 AM
                                2 responses
                                10 views
                                0 likes
                                Last Post bltdavid  
                                Working...
                                X