Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCA group is already filled - InteractiveBrokers

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

    OCA group is already filled - InteractiveBrokers

    I am trying to restart a strategy with "submit live working historical orders" and "cancel entry orders" set but without "cancel exits" or "sync".

    I have a strategy running on an instrument - USDCAD - and it's not letting me reenable because IB rejects the orders with "OCA group already filled 201".

    Code:
    $USDCAD    BuyToCover    Limit    150000    0.9764    0    Rejected: Order rejected - reason:OCA group is already filled (201)    0    0    150000    ExitShortAtLimit1    -b6e9f44d934a4ada95c71cbaf5116610    Gtc        DU58298    IB Simulated     NT-00013    ThreeDucks002    2612a35d93ce491bb33a980bb4d67eb4    05/10/2010 15:12:31    +    -    X    
    
    $USDCAD    BuyToCover    Stop    150000    0    1.0227    Rejected: Order rejected - reason:OCA group is already filled (201)    0    0    150000    ExitShortOnStop1    -b6e9f44d934a4ada95c71cbaf5116610    Gtc        DU58298    IB Simulated     NT-00014    ThreeDucks002    c77b2ba6d8274cd49bc71fb790befc73    05/10/2010 15:12:31    +    -    X
    Not only can I not re-enable the strategy, but NT closes the position for me, which I obviously don't want.

    Any advice?

    #2
    Hello adamus,

    Are these orders in a working state within TWS?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      No, there are no open orders on that instrument. It must be the previous target and stop that were entered with the same OCO name that is causing the problem.

      Comment


        #4
        Hello Adamus and Ryan,

        I have experienced the same (or related) issue on this thread:

        Support for the development of custom automated trading strategies using NinjaScript.


        Post #10 (08-12-2010, 03:51 AM) has details on how to recreate the issue.
        The Trading Mantis
        NinjaTrader Ecosystem Vendor - The Trading Mantis

        Comment


          #5
          Thank you both for your replies. Development is currently looking into this. Please avoid this scenario (triggering OCOs on the same account from different strategies) until the next beta.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            I think there is a difference there because as far as I understand it, you are seeing OCO orders when you don't want them, but I want OCO orders and use them all the time, but am unable to submit them under certain circumstances (probably to do with the crashes I had today - Ryan, if you want to see the logs & traces for those crashes: http://www.ninjatrader-support2.com/...cesAndLogs.zip )

            Comment


              #7
              I see this in your traces:
              2010-10-04 13:07:33:531 (IB Simulated ) Cbi.Order.Submit: Order='NT-00034/DU58298' Name='ExitLongOnStop1' State=Initialized Instrument='$GBPUSD' Action=Sell Limit price=0 Stop price=1.5765 Quantity=0.15M Strategy='ThreeDucks002' Type=Stop Tif=Gtc Oco='-7eee696b49354526979b1c32a21970b2' Filled=0 Fill price=0 Token='02f5d437f88b46a1a1cdf1fa9fcf9ede' Gtd='01/12/2099 00:00:00'

              - this likely is a custom set OCO ID, as NT would not set "negative" OCO Ids
              - when using custom OCO IDs you needed to make sure you don't re-use IDs from previous order placements where orders already had been filled/cancelled/... (which is the case according your traces, e.g. the order '1924989720' has the same OCO IDs and already is cancelled as you tried to place the offending order)
              - in case the OCO IDs had been generated by NT I recommend holding off furthers test until next update is out (2-3 weeks time frame)

              Comment


                #8
                Hi Dierk,

                thanks for checking it out. I'm not allocating OCO ids in my script, so it's either NT or IB that's doing it.

                I had to disconnect from IB and close TWS and restart, reconnect and re-enable my strategy before I could get those orders to submit.

                I can't follow your advice not to use OCOs. They are an integral part of my strategies and I'm just going to take the risk that it blows up again. Fingers crossed it should be ok - and at least the work-around works.

                Comment


                  #9
                  I suggest trying again with next update to not get confused by issues we already isolated and addresses in our sources.

                  Comment

                  Latest Posts

                  Collapse

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