¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

buy order at open if market open between a minimum and maximum


 

I would like to place a buy order that will fill at the open if the open price (or open ask) is between a certain minimum and maximum.

The maximum is easy enough (I think) using a limit on open order.? Can this be successfully used with a price condition for the minimum?? Something like:

o = Order()
o.action = 'BUY'
o.lmtPrice = maximum_entry_price
o.totalQuantity = qty
o.tif = 'OPG'


price_condition = Create(OrderCondition.Price)
price_condition.conId = contract.conId
price_condition.exchange =
'SMART'
price_condition.isMore = True
price_condition.triggerMethod = 4
price_condition.price = minimum_entry_price

I have used trigger method 4 (bid/ask) on the price condition so that I don't have to wait for a trade to complete before the conditioned logic is evaluated - does that provide any advantage?

Can anyone provide comment on whether the above approach will work, issues to consider, or other options?

Thanks!

Join [email protected] to automatically receive all group messages.