• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Have strategy avoid a TTR (tight trend range)

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

    Have strategy avoid a TTR (tight trend range)

    Hello,

    I was wondering if there is a way to stop my strategy from filling orders during a breakout/breakdown from a tight trending range (if high and low of previous 20 bars are within 2-2.5 points)? I'd like it to avoid those explosive moves for the following 2-5 bars after the breakout/breakdown.

    Thank you,
    Chris

    #2
    If it were me, I'd use a threshold based on a numerical minimum value for either the ATR or ADX indicators to take a trade. The short side trades on the ADX have a tendency to run well into the low teens, and still have decent momentum though, so you might want to have different thresholds for long or short trades.
    A minimum threshold for the Bollinger band width is another good option especially to detect the moment when volatility begins to rise.

    Originally posted by chrisca View Post
    Hello,

    I was wondering if there is a way to stop my strategy from filling orders during a breakout/breakdown from a tight trending range (if high and low of previous 20 bars are within 2-2.5 points)? I'd like it to avoid those explosive moves for the following 2-5 bars after the breakout/breakdown.

    Thank you,
    Chris

    Comment


      #3
      Hello Chris,

      If these orders are in a working state and at the exchange, they will have to be cancelled to avoid a fill. Aside from cancelling the order, you could use additional logic to control market orders, or you could use order methods without the isLiveUntilCancelled overload in the Managed Approach and call the order submission methods on each bar only when all of your criteria is met.

      Checking the if the difference between high and low from the last 20 bars are within a certain range can be achieved with a loop.
      Code:
      bool allowSubmission = false;
      for(int i = 0; i < SomeBars; i++)
      	if(High[i]-Low[i] > SomeLowBound && High[i]-Low[i] < SomeHighBound)
      		allowSubmission = true;
      I've included a link to our publicly available documentation on Advanced Order Handling for the thread's reference on isLiveUntilCancelled

      Advanced Order Handling (isLiveUntilCancelled) - https://ninjatrader.com/support/help...ancelledOrders

      Please let me know if I can be of further help.
      JimNinjaTrader Customer Service

      Comment


        #4
        Thanks guys,

        I'll plug in your ideas and see what I can come up with.

        Chris

        Comment


          #5
          If you are inclined and you both have enough width, and want to program it. You could do a short range "reversion to mean" strategy based on price moving back towards the center line of the BB's after having passed outside the upper or lower bollinger band first. And maybe even program it, so that if the price passes not merely that center line but continues through to the opposite BB band and follows it for a while, before falling away from that opposite BB .... that is your exit condition. Your choice. Study what is happening with the indicators immediately prior to a trend, or break out, and I'm sure you begin to pick up on possible patterns.
          good luck.

          Originally posted by chrisca View Post
          Thanks guys,

          I'll plug in your ideas and see what I can come up with.

          Chris

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by tonynt, Today, 12:39 PM
          0 responses
          7 views
          0 likes
          Last Post tonynt
          by tonynt
           
          Started by Martyb, 06-13-2019, 05:14 AM
          10 responses
          77 views
          0 likes
          Last Post iq200
          by iq200
           
          Started by Erwin Beckers, 11-04-2018, 02:39 AM
          4 responses
          71 views
          2 likes
          Last Post brucerobinson  
          Started by ntbone, Today, 01:25 AM
          0 responses
          6 views
          0 likes
          Last Post ntbone
          by ntbone
           
          Started by bomanpbm, Yesterday, 09:27 PM
          0 responses
          8 views
          0 likes
          Last Post bomanpbm  
          Working...
          X