Using Python and IB API how do you set lmt price to current market price. Below is an example where when you call make_order and you pass price with action and quantity. How to define price as 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
I would suggest a different order type such as Snap-To-Market or Snap-To-Midpoint if you want to do it in one step:
order = Order()
order.action = action
order.orderType = "SNAP MKT"
order.totalQuantity = quantity
order.auxPrice = offset