Remove commented out limit order logic while trades are still being placed using market orders

This commit is contained in:
moshferatu 2024-03-03 05:47:30 -08:00
parent bd2d13e444
commit 6a7dbe4aae

View File

@ -136,11 +136,6 @@ class Client:
leg_data = self.get_market_data(self.get_option_contract(leg))
leg_mid = (leg_data.ask + max(leg_data.bid, 0)) / 2.0
# Limit orders currently on hold while awaiting slippage metrics on market orders.
# leg_limit = (leg_mid - 0.25) - (leg_mid % 0.05)
# leg_limit = leg_limit if leg.action == BUY else -leg_limit
# option_order = self.submit_single_option_order(leg_data, limit_price = leg_limit)
option_order = self.submit_single_option_order(leg_data)
while not option_order.isDone():
self.ib.waitOnUpdate()
@ -155,11 +150,6 @@ class Client:
far_leg_mid = (far_leg_data.ask + max(far_leg_data.bid, 0)) / 2.0
spread_mid = near_leg_mid - far_leg_mid
# Limit orders currently on hold while awaiting slippage metrics on market orders.
# spread_limit = (spread_mid - 0.25) - (spread_mid % 0.05)
# spread_limit = spread_limit if near_leg.action == BUY else -spread_limit
# spread_order = self.submit_combo_option_order([near_leg, far_leg], limit_price = spread_limit)
spread_order = self.submit_combo_option_order([near_leg, far_leg])
while not spread_order.isDone():
self.ib.waitOnUpdate()