如何解决Interactive Brokers Python API错误-1 322处理请求
我正在尝试取消所有订单,但收到此错误消息
openorder ID:62 ES FUT @ GLOBEX:BUY STP 13.0已提交 orderStatus-orderid:62状态:预先提交已填充0.0剩余13.0 lastFillPrice 0.0
openorder ID:63 ES FUT @ GLOBEX:买LMT 13.0预先提交 orderStatus-orderid:63状态:预先提交已填充0.0剩余13.0 lastFillPrice 0.0
openorder ID:61 ES FUT @ GLOBEX:卖出STP LMT 13.0提交 orderStatus-orderid:61状态:已提交已填充0.0剩余13.0 lastFillPrice 0.0
错误-1 2104市场数据场连接正常:正在使用
错误-1 2158 Sec-def数据场连接正常:secdefil
错误-1 322错误处理请求:-'bt':原因-jextend.bt.l(bt.java:59)
EReader线程中未处理的异常
回溯(最近通话最近一次):
class IBapi(EWrapper,EClient):
posns = []
fname = 'OpenPos.txt'
def __init__(self):
EClient.__init__(self,self)
def nextValidId(self,orderId: int):
super().nextValidId(orderId)
self.nextorderId = orderId
def orderStatus(self,orderId,status,filled,remaining,avgFullPrice,permId,parentId,lastFillPrice,clientId,whyHeld,mktCapPrice):
print('orderStatus - orderid:','status:','filled','remaining','lastFillPrice',lastFillPrice)
def openorder(self,contract,order,orderState):
print('openorder id:',contract.symbol,contract.secType,'@',contract.exchange,':',order.action,order.orderType,order.totalQuantity,orderState.status)
def execDetails(self,reqId,execution):
print('Order Executed: ',contract.currency,execution.execId,execution.orderId,execution.shares,execution.lastLiquidity)
def run_loop():
app.run()
app = IBapi()
app.connect('127.0.0.1',7497,123)
time.sleep(2)
app.nextorderId = None
api_thread = threading.Thread(target=run_loop,daemon=True)
api_thread.start()
app.reqGlobalCancel()
time.sleep(3)
done=True
time.sleep(1)
app.disconnect()
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。