Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bracketing a range

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

    Bracketing a range

    I am struggling to bracket a range with two simultaneous orders, and I am not sure if I am violating one of the Internal Order Handling Rules.
    At the top of the range I want to enter a EnterShortLimit order, and at the bottom of the range I want to enter a EnterLongLimit.
    Is this possible?

    thanks.

    #2
    You cannot have two simultaneous working entry orders in opposite directions. Choose one or the other. If price moves closer to the other order, cancel the first and submit the other.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      You cannot have two simultaneous working entry orders in opposite directions. Choose one or the other. If price moves closer to the other order, cancel the first and submit the other.
      Do you have a code sample to do this? It makes a lot of sense. I'm currently running my strategy twice, once for long and once for short. Kind of a pain.

      If i don't keep the stop orders live, could I just submit a new stop order for the direction closest to the current close?

      let's say I bracket 10 and 20 and price is at 16 then for the next bar I submit buy stop at 20 and then next bar price goes to 14 I can submit a sell stop at 10?

      Thanks

      Comment


        #4
        Hello,

        I will have someone reply to you on Monday. Thank you for your patience.
        DenNinjaTrader Customer Service

        Comment


          #5
          Originally posted by cunparis View Post
          Do you have a code sample to do this? It makes a lot of sense. I'm currently running my strategy twice, once for long and once for short. Kind of a pain.

          If i don't keep the stop orders live, could I just submit a new stop order for the direction closest to the current close?

          let's say I bracket 10 and 20 and price is at 16 then for the next bar I submit buy stop at 20 and then next bar price goes to 14 I can submit a sell stop at 10?

          Thanks
          I was thinking of adding a 4 range chart and placing my orders on that. So that it'd always get triggered before the breakout. Doing this on a 1min might not work because the 1min bar could be really big and go from the bottom of the range to the top in 1min.

          Comment


            #6
            Unfortunately I'm not aware of a sample for this - for backtesting adding a finer chart would be needed - in realtime you could run your 1 min strategy on updating each tick (CalculateOnBarClose = false) and then monitor the last tick in relation to your set breakout range for placing the needed orders (would need to use liveUntilCancelled to not have orders auto expire at the next OnBarUpdate() then).

            Comment

            Latest Posts

            Collapse

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