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)