Announcement

Collapse
No announcement yet.

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:	440
Size:	35.1 KB
ID:	1181355
    Click image for larger version

Name:	Strat2.PNG
Views:	421
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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      45 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      31 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X