From 815fdfd043c4b8a20160bb5a906890e18dff2d6f Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 22 Feb 2024 12:36:57 -0800 Subject: [PATCH] Remove limit price logging as limit orders are not currently being used --- iron_condor.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/iron_condor.py b/iron_condor.py index ce65707..80039ed 100644 --- a/iron_condor.py +++ b/iron_condor.py @@ -121,18 +121,14 @@ def _enter_iron_condor(entry_time: datetime): long_call_leg = OptionLeg(symbol, expiration, long_call_strike, CALL, BUY, sub_symbol) call_spread_order = ibkr_client.submit_spread_order(short_call_leg, long_call_leg) - call_spread_mid = call_spread_order.mid_price - call_spread_limit = call_spread_order.limit_price - call_spread_fill = call_spread_order.fill_price - logging.info(f'Call Spread Mid Price: {call_spread_mid}') - logging.info(f'Call Spread Limit Price: {call_spread_limit}') - logging.info(f'Call Spread Fill Price: {call_spread_fill}') - logging.info(f'Call Spread Slippage: {call_spread_fill - call_spread_mid}') + logging.info(f'Call Spread Mid Price: {call_spread_order.mid_price}') + logging.info(f'Call Spread Fill Price: {call_spread_order.fill_price}') + logging.info(f'Call Spread Slippage: {call_spread_order.fill_price - call_spread_order.mid_price}') monitor_spread_price( short_leg = short_call_leg, long_leg = long_call_leg, - stop_price = call_spread_fill * 2, + stop_price = call_spread_order.fill_price * 2, client = ibkr_client ) @@ -140,18 +136,14 @@ def _enter_iron_condor(entry_time: datetime): long_put_leg = OptionLeg(symbol, expiration, long_put_strike, PUT, BUY, sub_symbol) put_spread_order = ibkr_client.submit_spread_order(short_put_leg, long_put_leg) - put_spread_mid = put_spread_order.mid_price - put_spread_limit = put_spread_order.limit_price - put_spread_fill = put_spread_order.fill_price - logging.info(f'Put Spread Mid Price: {put_spread_mid}') - logging.info(f'Put Spread Limit Price: {put_spread_limit}') - logging.info(f'Put Spread Fill Price: {put_spread_fill}') - logging.info(f'Put Spread Slippage: {put_spread_fill - put_spread_mid}') + logging.info(f'Put Spread Mid Price: {put_spread_order.mid_price}') + logging.info(f'Put Spread Fill Price: {put_spread_order.fill_price}') + logging.info(f'Put Spread Slippage: {put_spread_order.fill_price - put_spread_order.mid_price}') monitor_spread_price( short_leg = short_put_leg, long_leg = long_put_leg, - stop_price = put_spread_fill * 2, + stop_price = put_spread_order.fill_price * 2, client = ibkr_client )