IBKR交易停止指令触发方法覆盖(Python)
我刚开始学习交互式代理Python API。我有一个问题,关于如何覆盖下达止损单的触发方法 IB帮助文档说明:IBKR交易停止指令触发方法覆盖(Python),python,api,algorithmic-trading,Python,Api,Algorithmic Trading,我刚开始学习交互式代理Python API。我有一个问题,关于如何覆盖下达止损单的触发方法 IB帮助文档说明: @staticmethod def Stop(action:str, quantity:float, stopPrice:float): # ! [stop] order = Order() order.action = action order.orderType = "STP" order.auxPrice =
@staticmethod
def Stop(action:str, quantity:float, stopPrice:float):
# ! [stop]
order = Order()
order.action = action
order.orderType = "STP"
order.auxPrice = stopPrice
order.totalQuantity = quantity
# ! [stop]
return order
同样对于触发方法:
触发方法
IBApi.Order
类中定义的触发方法指定如何触发模拟停止、停止限制、后续停止和条件命令。有效值为:
- 0-仪器的默认方法
- 1-“双重出价/询问”功能,其中基于 连续两次出价或要价
- 2-“最后一次”功能,根据 最后价格
- 3-“双末次”功能
- 4-出价/询问功能
- 7-最后或出价/询问功能
- 8-中点函数
order.triggermethod=1
?谢谢你的帮助