mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-19 06:11:15 +00:00
fix(api): only write export when backtest happened
closes freqtrade/frequi#2282
This commit is contained in:
@@ -99,16 +99,18 @@ def __run_backtest_bg(btconfig: Config):
|
|||||||
ApiBG.bt["data"], ApiBG.bt["bt"].all_results, min_date=min_date, max_date=max_date
|
ApiBG.bt["data"], ApiBG.bt["bt"].all_results, min_date=min_date, max_date=max_date
|
||||||
)
|
)
|
||||||
|
|
||||||
if btconfig.get("export", "none") == "trades":
|
if btconfig.get("export", "none") == "trades":
|
||||||
combined_res = combined_dataframes_with_rel_mean(ApiBG.bt["data"], min_date, max_date)
|
combined_res = combined_dataframes_with_rel_mean(
|
||||||
fn = store_backtest_results(
|
ApiBG.bt["data"], min_date, max_date
|
||||||
btconfig,
|
)
|
||||||
ApiBG.bt["bt"].results,
|
fn = store_backtest_results(
|
||||||
datetime.now().strftime("%Y-%m-%d_%H-%M-%S"),
|
btconfig,
|
||||||
market_change_data=combined_res,
|
ApiBG.bt["bt"].results,
|
||||||
)
|
datetime.now().strftime("%Y-%m-%d_%H-%M-%S"),
|
||||||
ApiBG.bt["bt"].results["metadata"][strategy_name]["filename"] = str(fn.stem)
|
market_change_data=combined_res,
|
||||||
ApiBG.bt["bt"].results["metadata"][strategy_name]["strategy"] = strategy_name
|
)
|
||||||
|
ApiBG.bt["bt"].results["metadata"][strategy_name]["filename"] = str(fn.stem)
|
||||||
|
ApiBG.bt["bt"].results["metadata"][strategy_name]["strategy"] = strategy_name
|
||||||
|
|
||||||
logger.info("Backtest finished.")
|
logger.info("Backtest finished.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user