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

Simple 30 Bar Breakout Strategy

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

    Simple 30 Bar Breakout Strategy

    Hello everyone,
    these are my first steps with the Ninjatrader Strategy Builder
    I am trying to develop a simple breakout strategy, which basically buys at the next bar as soon as the close is higher than the high of the last 30 bars. Currently my condition looks like the following picture, but there is no execution, so there seems to be something wrong with what i've picked.


    Click image for larger version  Name:	Strat.PNG Views:	0 Size:	32.7 KB ID:	1181323
    Would appreciate some help
    Thanks everyone
    Last edited by funtra513; 12-11-2021, 12:09 PM. Reason: MAX(), Breakout Strategy

    #2
    So I found a solution for the problem myself, sometimes just walking away, taking a nap and waiting a few hours helps

    For everyone, whos having the same problem:
    The lookback period has to be set to 1, so the current bar isn't taken into consideration, which messed up the strategy. I've included it in the two attached pictures.
    Click image for larger version

Name:	Strat.PNG
Views:	308
Size:	35.1 KB
ID:	1181355
    Click image for larger version

Name:	Strat2.PNG
Views:	297
Size:	39.9 KB
ID:	1181356

    Comment


      #3
      Hello funtra513,

      Below I am providing a link to a forum post with helpful information about getting started with NinjaScript.


      I'm glad you were able to work out a solution.

      Yes, using Bars ago 1, would check the previous bar's information, and allow an action on the current bar.

      You could also use a bool that is set true when the condition is true as the last set tab, then on the next bar in an earlier set when true trigger an action and set the bool back to false.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      28 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      19 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      3 views
      0 likes
      Last Post funk10101  
      Started by gravdigaz6, Yesterday, 11:40 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Yesterday, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X