diff --git a/freqtrade/data/metrics.py b/freqtrade/data/metrics.py index a4b6898e2..cf59c330a 100644 --- a/freqtrade/data/metrics.py +++ b/freqtrade/data/metrics.py @@ -74,9 +74,10 @@ def combined_dataframes_with_rel_mean( df_comb = combine_dataframes_by_column(data, column) # Trim dataframes to the given timeframe df_comb = df_comb.iloc[(df_comb.index >= fromdt) & (df_comb.index < todt)] + rel_mean = df_comb.pct_change().mean(axis=1).fillna(0).cumsum() df_comb["count"] = df_comb.count(axis=1) df_comb["mean"] = df_comb.mean(axis=1) - df_comb["rel_mean"] = df_comb["mean"].pct_change().fillna(0).cumsum() + df_comb["rel_mean"] = rel_mean return df_comb[["mean", "rel_mean", "count"]]