Add year to backtest breakdowns

This commit is contained in:
mrpabloyeah
2025-03-09 18:21:33 +01:00
parent 805e03b83b
commit a0cbdc9135
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ AVAILABLE_PAIRLISTS = [
"VolatilityFilter", "VolatilityFilter",
] ]
AVAILABLE_DATAHANDLERS = ["json", "jsongz", "feather", "parquet"] AVAILABLE_DATAHANDLERS = ["json", "jsongz", "feather", "parquet"]
BACKTEST_BREAKDOWNS = ["day", "week", "month"] BACKTEST_BREAKDOWNS = ["day", "week", "month", "year"]
BACKTEST_CACHE_AGE = ["none", "day", "week", "month"] BACKTEST_CACHE_AGE = ["none", "day", "week", "month"]
BACKTEST_CACHE_DEFAULT = "day" BACKTEST_CACHE_DEFAULT = "day"
DRY_RUN_WALLET = 1000 DRY_RUN_WALLET = 1000
@@ -212,6 +212,8 @@ def _get_resample_from_period(period: str) -> str:
return "1W-MON" return "1W-MON"
if period == "month": if period == "month":
return "1ME" return "1ME"
if period == "year":
return "1Y"
raise ValueError(f"Period {period} is not supported.") raise ValueError(f"Period {period} is not supported.")