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 DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          11 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          7 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X