diff --git a/trade_report.py b/trade_report.py index 566a871..9b1376f 100644 --- a/trade_report.py +++ b/trade_report.py @@ -44,7 +44,14 @@ for _, backtest in backtest_data.iterrows(): close_price = round(spread['Close'], 2) backtest_info[(entry_time, spread_type)] = (short_strike, long_strike, open_price, close_price) -print(f'**Backtest Profit**: {round(backtest_profit(trade_date), 2)}\n') +trade_profits = [100 * (info[2] - info[3]) for info in trade_info.values()] +profit = sum(trade_profits) +print(f'**Profit**: {round(profit, 2)}') + +profit_backtest = backtest_profit(trade_date) +print(f'**Backtest Profit**: {round(profit_backtest, 2)}') + +print(f'**Difference**: {round(profit - profit_backtest, 2)}\n') open_differences = [backtest_info[key][2] - trade_info[key][2] for key in trade_info] average_open_difference = sum(open_differences) / len(open_differences) if open_differences else 0