Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

High of x bars back

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

    High of x bars back

    Is it possible to achieve following in strategy builder in Ninja8?. I have tried but could not come up with correct sequence on what i want to do , not a programmer so rely on strategy builder.

    Long = buy when price is one tick above high of last 5 bars
    Short = sellshort when price is one tick lower than low of 5 bars

    I want to enter as stop order dont want to wait until bar closes. Also want to use an input for bar back from 5-40 so i can optimize it. Help is appreciated. Thx

    #2
    Hello trader333,

    Thanks for your post.

    To enter an order intrabar you will need to run your strategy with Calculate.OnPriceChange (or Calculate.OnEachTick).

    To obtain the highest high of the last 5 bars you can use the MAX() indicator where you would select the High price series as the input and use a bars ago of 1 and check to see if the close price (which will be the current price in either of the Calculate modes used) is Greater than or equal to the MAX indicator results.

    To obtain the lowest low of the last 5 bars you can use the MIN() indicator where you would select the Low price series as the input and use a bars ago of 1 and check to see if the close price (which will be the current price in either of the Calculate modes used) is Less than or equal to the MIN indicator results.

    To use a stop order for entry you would have to place the order above the current price for long or below the current price for short.

    You would not be able to place a longstop and a shortstop order at the same time as this would violate the internal order handling rules, these can found here: " Internal Order Handling Rules that Reduce Unwanted Positions" https://ninjatrader.com/support/help...d_approach.htm

    An approach might be to use some additional criteria which would determine which order to submit (long or short) to not violate the internal rules.

    Comment


      #3
      Thanks Paul, I was wondering if it could be done in strategy builder, if yes how

      Comment


        #4
        Hello trader333,

        Thanks for your reply.

        My response was based on the strategy builder.

        You'll need to create this yourself as we do not provide custom strategy work.

        If you would like it created for you we can provide references to 3rd party programmers.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        561 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X