feat: add reduce_df_footprint to backtest/hyperopt modes

Co-authored-by: alisayyah <ali.sayyah2@gmail.com>
This commit is contained in:
Matthias
2025-04-08 19:20:27 +02:00
parent 8de5e2b7b8
commit 2d194995bc

View File

@@ -12,6 +12,7 @@ from pandas import DataFrame
from freqtrade.constants import CUSTOM_TAG_MAX_LENGTH, Config, IntOrInf, ListPairsWithTimeframes
from freqtrade.data.converter import populate_dataframe_with_trades
from freqtrade.data.converter.converter import reduce_dataframe_footprint
from freqtrade.data.dataprovider import DataProvider
from freqtrade.enums import (
CandleType,
@@ -1735,7 +1736,13 @@ class IStrategy(ABC, HyperStrategyMixin):
)
self._if_enabled_populate_trades(dataframe, metadata)
return self.populate_indicators(dataframe, metadata)
dataframe = self.populate_indicators(dataframe, metadata)
if self.config.get("reduce_df_footprint", False) and self.config.get("runmode") not in [
RunMode.DRY_RUN,
RunMode.LIVE,
]:
dataframe = reduce_dataframe_footprint(dataframe)
return dataframe
def advise_entry(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
"""