Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One cancels other with a stop and two targets

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

    One cancels other with a stop and two targets

    Let's say I have an open position with 10 contracts, a stop for 10 contracts, and two targets, one for 5 contracts each. If the stop is hit, I want both target orders cancelled. But if the first target is reached, I'd like the stop to self-adjust, and for the second target to remain open. Will an OCO do this?

    I'm placing orders from TradeStation through and NT.DLL. Do I just give the OCO any name I want in NTChange()?

    #2
    Hello douggreen,

    An OCO will cancel all orders that are part of the OCO group, when any one of these are filled. You don't specify OCO here since you still want your stop loss to be active when your target is filled. Any adjustments can take place by manually changing orders.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      So, is this possible?

      I stated my scenario a little backwards, but I think that this is a problem.

      Assume the following setup

      1. LONG 10 contracts
      2. SELL LIMIT ORDER for 10 contracts OCO, 50 ticks above the current price
      3. SELL STOP ORDER for 5 contracts, 10 ticks below the current price
      4. SELL STOP ORDER for 5 contracts OCO, 30 ticks below the current price

      I see a couple scenerios where I might close the order but then fill something unintentionally. All scenerios assume a volatile market, where price moves wildly on a single bar.

      1. If target is reached, it will cancel the stop order for 30 ticks below the current price, but it's quite possible that I might then hit the stop for 10 ticks below the current price, and rather than being FLAT, I'll be SHORT 5 contracts.

      2. If the stop 10 ticks below my price is hit first, it's possible that it will then go up and hit my target, and once again, rather than being FLAT, I'll be SHORT 5 contracts.

      What I think is missing is TradeStation's concept "BuyToCover" and "Sell" verses "SellShort". Do I understand this correctly? If so, there seems to be no safe solution.

      Comment


        #4
        Yes, unfortunately this is a risk of electronic trading.

        You can reduce chances of this a good bit by working directly in NinjaScript rather than the extra TradeStation layer.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          It occured to me that I simply need two different one-cancels-other groups, and I'll have two target orders instead of 1.

          For example, if I'm long 10 contracts:

          OCO group1: target 8 contracts, stop 8 contracts at stop1
          OCO group2: target 2 contracts, stop 2 contracts at stop2

          I think that really covers everything. If you hit stop, it will cancel the target for the 2 contracts, but leave the rest in play. If you hit the target, you'll fill both targets hopefully, and cancel both stops.

          Comment


            #6
            Thanks for the follow up, and sharing your approach to this, douggreen.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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