import pandas as pd def run(): csv_file = 'backtest_results/AAPL+MSFT+NVDA+SPY+QQQ+TSLA+AMD+GOOG+META+AMZN+JPM+GS+V+JNJ+PFE+UNH+XOM+CVX+WMT+KO+CAT+GE+DIS+NFLX+IWM_2026-03-09_2026-04-13_trades.csv' df = pd.read_csv(csv_file) print("Exit Reason Analysis") print("-" * 40) time_stops = df[df['exit_reason'] == 'time_stop'] stop_losses = df[df['exit_reason'] == 'stop_loss'] take_profits = df[df['exit_reason'] == 'take_profit'] print(f"Time Stops: {len(time_stops)} trades, Average PnL: ${time_stops['pnl'].mean():.2f}") if len(stop_losses) > 0: print(f"Stop Losses: {len(stop_losses)} trades, Average PnL: ${stop_losses['pnl'].mean():.2f}") else: print("Stop Losses: 0 trades") if len(take_profits) > 0: print(f"Take Profits: {len(take_profits)} trades, Average PnL: ${take_profits['pnl'].mean():.2f}") else: print("Take Profits: 0 trades") print("\nImpact of Lower TP (2.0R vs 3.0-3.5R):") print("A lower take profit (e.g., 2.0R) would likely increase the win rate by closing trades earlier, but would reduce the average win size.") print("This could be beneficial for a smaller account ($300) to ensure faster equity turnover and reduce time-in-market risk.") if __name__ == "__main__": run()