diff --git a/backtesting/backtest_iron_condor.py b/backtesting/backtest_iron_condor.py index 500a2c2..fe74b3b 100644 --- a/backtesting/backtest_iron_condor.py +++ b/backtesting/backtest_iron_condor.py @@ -278,10 +278,6 @@ def backtest_iron_condor( filters: List[BacktestFilter] = [] ) -> pd.DataFrame: - total_premium_received = 0.0 - total_trades = 0.0 - total_wins = 0.0 - start_year = start_date.year end_year = end_date.year @@ -313,6 +309,7 @@ def backtest_iron_condor( futures.append(future) backtest_results = [] + total_premium_received = 0.0 for future in futures: backtest_result = future.result() if backtest_result: @@ -320,15 +317,6 @@ def backtest_iron_condor( backtest_result.profit = total_premium_received backtest_results.append(backtest_result) - if backtest_result.trade_entered: - total_trades += 1 - if backtest_result.trade_pnl > 0.0: - total_wins += 1 - - logging.info('Overall PnL: %f', total_premium_received) - logging.info('Win Rate: %f', (total_wins / total_trades) if total_trades > 0 else 0.0) - logging.info('Average Premium Received: %f', (total_premium_received / total_trades) if total_trades > 0 else 0.0) - # TODO: Either look up the symbol in the historical option data or have the client provide it. backtest_results = pd.DataFrame([{ 'Date': result.date,