简体   繁体   中英

TWS API ib insync Bracket Order Delay for 35+ sec after Submitted

I got a bracket order using ib_insync.
But for whatever reason, when the orders are submitted to TWS, only the parent order will show up with "Transmit" button beside it as shown in the screen shoot below.
It then does nothing for 35+ sec. Then the entire bracket orders are sent out. 在此处输入图片说明

Here are my code for the bracket order:

    bracket = ib_val.bracketOrder("BUY", 4, current_price, current_price + 1, current_price - 3)
    bracket.parent.orderType = "MKT"
    for each_order in bracket:
        orderTrade = ib_val.placeOrder(contract_val, each_order)
        orderTrade.orderStatus.status = "Submitted"

Did I screwed up something?
Where is the code going wrong?

Thank you very much

此问题已通过在括号顺序后添加 time.sleep(1) 解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM