@@ -99,16 +99,18 @@ def __run_backtest_bg(btconfig: Config):
9999 ApiBG .bt ["data" ], ApiBG .bt ["bt" ].all_results , min_date = min_date , max_date = max_date
100100 )
101101
102- if btconfig .get ("export" , "none" ) == "trades" :
103- combined_res = combined_dataframes_with_rel_mean (ApiBG .bt ["data" ], min_date , max_date )
104- fn = store_backtest_results (
105- btconfig ,
106- ApiBG .bt ["bt" ].results ,
107- datetime .now ().strftime ("%Y-%m-%d_%H-%M-%S" ),
108- market_change_data = combined_res ,
109- )
110- ApiBG .bt ["bt" ].results ["metadata" ][strategy_name ]["filename" ] = str (fn .stem )
111- ApiBG .bt ["bt" ].results ["metadata" ][strategy_name ]["strategy" ] = strategy_name
102+ if btconfig .get ("export" , "none" ) == "trades" :
103+ combined_res = combined_dataframes_with_rel_mean (
104+ ApiBG .bt ["data" ], min_date , max_date
105+ )
106+ fn = store_backtest_results (
107+ btconfig ,
108+ ApiBG .bt ["bt" ].results ,
109+ datetime .now ().strftime ("%Y-%m-%d_%H-%M-%S" ),
110+ market_change_data = combined_res ,
111+ )
112+ ApiBG .bt ["bt" ].results ["metadata" ][strategy_name ]["filename" ] = str (fn .stem )
113+ ApiBG .bt ["bt" ].results ["metadata" ][strategy_name ]["strategy" ] = strategy_name
112114
113115 logger .info ("Backtest finished." )
114116
0 commit comments