From 07750518c3e50711a0b8965f2535537b07402ba5 Mon Sep 17 00:00:00 2001 From: Sergey Khliustin Date: Mon, 4 Oct 2021 18:49:57 +0300 Subject: [PATCH] Added min_profit param to PerformanceFilter --- freqtrade/plugins/pairlist/PerformanceFilter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/freqtrade/plugins/pairlist/PerformanceFilter.py b/freqtrade/plugins/pairlist/PerformanceFilter.py index 301ee57ab..f235816b8 100644 --- a/freqtrade/plugins/pairlist/PerformanceFilter.py +++ b/freqtrade/plugins/pairlist/PerformanceFilter.py @@ -21,6 +21,7 @@ class PerformanceFilter(IPairList): super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos) self._minutes = pairlistconfig.get('minutes', 0) + self._min_profit = pairlistconfig.get('min_profit', None) @property def needstickers(self) -> bool: @@ -68,6 +69,8 @@ class PerformanceFilter(IPairList): sorted_df = list_df.merge(performance, on='pair', how='left')\ .fillna(0).sort_values(by=['count', 'pair'], ascending=True)\ .sort_values(by=['profit'], ascending=False) + if self._min_profit is not None: + sorted_df = sorted_df[sorted_df['profit'] >= self._min_profit] pairlist = sorted_df['pair'].tolist() return pairlist