【发布时间】:2019-08-08 13:53:31
【问题描述】:
如何使用 Python 和 IB API 将 lmt 价格设置为当前市场价格。下面是一个示例,当您调用 make_order 并通过操作和数量传递价格时。如何将价格定义为 MarketPrice?
def make_order(action, quantity,price):
if price is not None:
order = Order()
order.m_orderType = 'LMT'
order.m_totalQuantity = 2
order.m_action = action
order.m_lmtPrice = price
order.m_outsideRth = True
【问题讨论】:
标签: python-3.x interactive-brokers