Ib Java Api Update Order Prob

Discussion in 'App Development' started by Nab, Sep 17, 2012.

  1. Nab

    Nab

    Hey,

    I have the following problem with the IB JAVA API (with IB GW), hopefully someone can help :) :

    Updating STPLMT orders after submission via placeOrder with new LMT price works fine. However, after reseting the API connection, and re-importing the order data via reqOpenOrders, a placeOrder with the returned order data + new LMT fails with the error code

    297 | 321 | Error validating request:-'ic' : cause - Cannot set VOL attribute on non-VOL order.

    Which seems a bit strange ... is this problem known?
    (the order data reqOpenOrders returns appears to me a bit inconsistent, at least it returns for m_orderType="STP LMT" instead of "STPLMT", but that alone does not solve the prob ...)

    Thx
    Nab
     
  2. 2rosy

    2rosy

    its probably your code. without that no one can help
     
  3. mickmak

    mickmak

    first question - why do you need to repeat the same order action? If your API connection is disconnected and you reconnect at a later time, (as long as your order time enforcement is OK) you should get all of your open orders back. No need to send those orders back in.

    I haven't used IB Java API, but potentially you maybe trying to update the order before allowing the GW to register the order place call. Are you trying to do both in the same temporal sequence (i.e. without processing the receipt of order confirm?).
     
  4. Nab

    Nab

    I need the order data back into my application such that I can update it with a new LMT, if needed. However, the returned order data via reqOpenOrders gives the above described problem if I try to resubmit it to update the LMT ... (this problem does not occur with the original order data (no disconnect & reimport), which I can update without any problems via resubmission)
     
  5. Nab

    Nab

    Maybe, but I'm not so sure about that... the code is quite simple.
    Basically, I'm just taking the Order openOrder returns and resubmit it with a new m_lmtPrice ...