From 05288fc2351c691bfc3f3529f146258f99040a85 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 1 Feb 2024 06:14:00 -0800 Subject: [PATCH] Removing comments as backtest is now successful over all dates and entry times in 2018 --- backtesting/backtest_iron_condor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backtesting/backtest_iron_condor.py b/backtesting/backtest_iron_condor.py index 2d6f286..a0716a8 100644 --- a/backtesting/backtest_iron_condor.py +++ b/backtesting/backtest_iron_condor.py @@ -59,7 +59,7 @@ def get_spread_history_credit(historical_option_data: pd.DataFrame, option_strat long_strike = short_strike + (option_strat.spread_width if option_strat.option_type == OptionType.CALL else -option_strat.spread_width) # Sometimes the strike we're interested in doesn't exist. Find the nearest one that does. increment = 5.0 if option_strat.option_type == OptionType.CALL else -5.0 - while opening_quotes_by_contract_type[(opening_quotes_by_contract_type['strike'] == long_strike)].empty: # TODO: Doesn't work for one day in 2018. + while opening_quotes_by_contract_type[(opening_quotes_by_contract_type['strike'] == long_strike)].empty: long_strike = long_strike + increment logging.info('Long Strike: %s', long_strike) @@ -82,7 +82,7 @@ def get_spread_history(historical_option_data: pd.DataFrame, option_strat: Delta long_strike = short_strike + (option_strat.spread_width if option_strat.option_type == OptionType.CALL else -option_strat.spread_width) # Sometimes the strike we're interested in doesn't exist. Find the nearest one that does. increment = 5.0 if option_strat.option_type == OptionType.CALL else -5.0 - while opening_quotes[(opening_quotes['strike'] == long_strike)].empty: # TODO: Doesn't work for one day in 2018. + while opening_quotes[(opening_quotes['strike'] == long_strike)].empty: long_strike = long_strike + increment logging.info('Long Strike: %s', long_strike)