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

Question on creating breakout strategy using NinjaTrader 7 Strategy Wizard

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

    Question on creating breakout strategy using NinjaTrader 7 Strategy Wizard

    Hi,

    I want to create a breakout strategy using NinjaTrader 7 Strategy Wizard. Basically I want to write the following condition: Go long today if today's price goes above last 10 days' high (last 10 days excluding today). I was not able to see an option in Strategy Wizard where I can mention Highest High of the last few bars. The closest that I found was "Misc->HIghest Bar", where I can mention the period also. But then, it doesn't accept User Defined Inputs, because of which optimisation through Strategy Analyser is not possible.

    Am I missing something here?

    Further, is there any tutorial available on creating breakout strategies using NinjaTrader 7 Strategy Wizard? Or are there any sample codes available for the same?

    Thanks

    #2
    Hello,

    Thank you for the post and welcome to the NinjaTrader forum.

    Highest bar is the only way through the Strategy Wizard to get a maximum value. One thing you might do is run the strategy on a daily chart and set the period of Highest bar to 10 since each bar is 1 day.

    Otherwise, you would have to unlock the strategy code and use the MAX() function.

    Here is how you would get the Highest high up to 10 bars ago, not including today's bar, of a daily data series.

    Code:
    double HighestPastValue = MAX(High,10)[1];
    Here you may browse all NinjaTrader 7 Strategies that have been uploaded to the forum. There are quite a few with the name "breakout". All of these uploads are open source so you can look through them and see how they work:



    Please let us know if we may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Does the "Highest Bar" option support Optimization?

      Sir,

      Thank you for the prompt reply. As I had mentioned in my question, from what I understand, I can't use User Defined Variables within "Highest Bar" option, because of which I can't use optimisation through Strategy Analyser. Basically I want to know if I can force the "Highest Bar" value to vary from 1 to 100 using Strategy Analyser. Is it possible?

      Thanks

      Comment


        #4
        Hello,

        Thank you for the follow-up.

        The only way to have parameters show up in the Strategy Analyzer grid is to make your user variable a public property in your script (User input) and use that user input on Highest bar. You can make public properties in the Strategy Wizard but 'Highest bar' is not able to take any variables.

        This can be done in NinjaTrader 8 though, many new features were added to the Strategy Builder that allow most functions to take variables as parameters instead of static values.

        You may read more about the Strategy builder on this help guide page:


        Please let me know if you have any questions.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChrisL View Post
          Hello,

          Thank you for the follow-up.

          The only way to have parameters show up in the Strategy Analyzer grid is to make your user variable a public property in your script (User input) and use that user input on Highest bar. You can make public properties in the Strategy Wizard but 'Highest bar' is not able to take any variables.

          This can be done in NinjaTrader 8 though, many new features were added to the Strategy Builder that allow most functions to take variables as parameters instead of static values.

          You may read more about the Strategy builder on this help guide page:


          Please let me know if you have any questions.
          Hi,

          Thank you for the reply. As you had suggested, I tried searching to see if I can allow 'Highest bar' to take variables as parameters instead of static values in NinjaTrader 8. However, even in NinjaTrader 8, in the Strategy Builder window, I couldn't find an option where Highest bar can accept variables; it seems to accept only static value even in NinjaTrader 8. Maybe I didn't follow the instructions properly. Can you please let me know how Ican force "Highest bar" to accept variables rather than static variables in NinjaTrader 8.

          Thanks

          Comment


            #6
            Hello vineeth,

            I provided an example in NT8 using MAX, which accepts a user input for bars back.


            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CortexZenUSA, Today, 12:53 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by CortexZenUSA, Today, 12:46 AM
            0 responses
            1 view
            0 likes
            Last Post CortexZenUSA  
            Started by usazencortex, Today, 12:43 AM
            0 responses
            5 views
            0 likes
            Last Post usazencortex  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,266 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X