IB API Error 154 Orders cannot be transmitted for a halted security.

Discussion in 'Automated Trading' started by Craig66, Mar 14, 2020.

  1. Craig66

    Craig66

    Given what has been happening this week, has anybody seen this error in the wild (or others)?
    If so, will the order go inactive as with other similar errors?
     
  2. Robert Morse

    Robert Morse Sponsor

    This is not an error but an exchange rule that requires a Compliance check to see if Markets are halted before sending an order.
     
    IAS_LLC likes this.
  3. Craig66

    Craig66

    OK, but I don't suppose you know if the order state is set 'inactive' or 'rejected'?
     
  4. Robert Morse

    Robert Morse Sponsor

    You will have to compare your error code to The IB Docs. The exchange sends out a code like “H” or “T1” etc.
     
  5. Craig66

    Craig66

    'IB Docs' - Hilarious :)
     
  6. guru

    guru


    Can you check in TWS whether that order is there?
    Though for unknown errors I send order cancellation via the API, then try resubmitting.
     
  7. Craig66

    Craig66

    I don't have TWS open, I'm using the gateway.
    I haven't actually seen this error, I just want to be ready if I do get it.
     
    guru likes this.
  8. d08

    d08

    I can tell you that I had orders with GAT parameter that were designed to go off during halt periods. They were simply executed when the market re-opened.
    I'm unsure how things would go for submitting during a halt. As always with stuff like this, write a test and wait for conditions. Asking support for this is a lottery, you're likely to get a random answer that is just a guess.
    For other instances you will just wait for 154 in your error handler and resubmit again and again. Or go fancy and read the halt times via some interface and sleep until that.
     
  9. Craig66

    Craig66

    At the moment, I assume the order will be "Inactive" and pause for 5 minutes.