Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order cancelled error

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

    Order cancelled error

    I am testing a new strategy on IB's real-time simulated account. I saw the following errors appear last night and I'd appreciate it if you could let me know whether I'm cancelling my orders correctly or whether there's another issue.

    What is reason 202? Is that my call to Cancel()?

    The following are in chronological order:

    HTML Code:
    20/02/2011 23:43:00    Order     Order='1661912734/DU58298' Name='Stop loss' New state=Cancelled  Instrument='$EURUSD' Action=Buy Limit price=0 Stop price=1.3778  Quantity=0.1M Type=Stop Filled=0 Fill price=0 Error=NoError Native  error='Order Canceled - reason: (202)'    
    20/02/2011 23:43:00    Order    Order='1661912731/DU58298' Name='Profit target' New state=Rejected Instrument='$GBPJPY' Action=Buy Limit price=134.89 Stop price=0 Quantity=0.1M Type=Limit Filled=0 Fill price=0 Error=OrderRejected Native error='Cancel attempted when order is not in a cancellable state.  Order permId =1661912731 (161)'    
    20/02/2011 23:43:00    Order    IB Simulated, Cancel attempted when order is not in a cancellable state.  Order permId =1661912731 (161) affected Order: Buy 100000 Limit @ 134.89    

    #2
    adamus, did you attempt to cancel the order as it was already cancelled by IB's native OCO handling thus returning this native error back?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      It is part of an OCO pair, but the other order was not executed.

      I investigated this further and realised that this happened just after I started the strategy.

      I started the time at exactly 23:42:37. It does a lot of historical processing before starting, perhaps enough to cause this problem. It's trading 21 instruments on a 1-mins timeframe.

      In my logs from the strategy, I see it was short virtually/historically from 22:36 so it had the target/stop OCO pair on since then. The stop was at 135.60 which was never close, so as far as I can tell it had no reason to cancel. It was a couple of pips away from being executed itself, although the historical data shows it would never have been executed.

      What does 202 signify?

      Comment


        #4
        It's a native error thrown from the IB API - http://www.interactivebrokers.com/ph...c++/errors.htm I suggest to contact them directly to check why it was returned for this order in particular.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          OK I see. I thought it was a NT code. So the reason should be given but is blank - I can't see IB Support being able to help.

          I think what has happened is that NT was unable to handle the start-up transition from historical to live and should never have submitted that cancel.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Belfortbucks, Today, 09:29 PM
          0 responses
          2 views
          0 likes
          Last Post Belfortbucks  
          Started by zstheorist, Today, 07:52 PM
          0 responses
          7 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          150 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          6 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Working...
          X