我想获取我之前订单的状态。我有以下简单的代码,但我只得到 True/False 值。这是我的代码:
from ib.opt import Connection, message
tws_conn = Connection.create(port=7497, clientId=999)
tws_conn.connect()
def acct_update(msg):
print msg
tws_conn.register(acct_update, message.openOrder)
tws_conn.register(acct_update, message.orderStatus)
这是输出:
>>> from ib.opt import Connection, message
>>>
>>> tws_conn = Connection.create(port=7497, clientId=999)
>>> tws_conn.connect()
Server Version: 76
TWS Time at connection:20161021 18:53:42 EST
True
>>>
>>> def acct_update(msg):
... print msg
...
>>> tws_conn.register(acct_update, message.openOrder)
True
>>> tws_conn.register(acct_update, message.orderStatus)
True
>>>
>>>
如何获取未结订单列表?以及如何获取单个订单的状态?
谢谢。