Remove unnecessary code

This commit is contained in:
moshferatu 2024-01-30 12:37:22 -08:00
parent 98ce824d19
commit f0f6e02a12

View File

@ -169,8 +169,6 @@ def _backtest_iron_condor(
trades_entered = False
call_spread_stopped_out = False
put_spread_stopped_out = False
took_profit = False
took_early_loss = False
max_profit = 0.0
max_drawdown = 0.0
@ -256,12 +254,11 @@ def _backtest_iron_condor(
if current_profit_dollars < max_drawdown:
max_drawdown = current_profit_dollars
if not took_profit and not took_early_loss:
if not call_spread_stopped_out and current_call_spread_price > 0.05:
if not call_spread_stopped_out and current_call_spread_price > 0.05:
premium_received -= current_call_spread_price
if not put_spread_stopped_out and current_put_spread_price > 0.05:
premium_received -= current_put_spread_price
if not put_spread_stopped_out and current_put_spread_price > 0.05:
premium_received -= current_put_spread_price
number_of_contracts = call_spread_strategy.number_of_contracts
stop_out_fees = 0.0 # It costs money to get stopped out.