diff --git a/config_full.json.example b/config_full.json.example index 270938237..5ceeaff09 100644 --- a/config_full.json.example +++ b/config_full.json.example @@ -61,7 +61,7 @@ } }, {"method": "PrecisionFilter"}, - {"method": "LowPriceFilter", "low_price_ratio": 0.01 + {"method": "PriceFilter", "low_price_ratio": 0.01 } ], "exchange": { diff --git a/docs/configuration.md b/docs/configuration.md index 120842cdb..ed50b521e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -380,7 +380,7 @@ The valid values are: Pairlists define the list of pairs that the bot should trade. There are [`StaticPairList`](#static-pair-list) and dynamic Whitelists available. -[`PrecisionFilter`](#precision-filter) and [`LowPriceFilter`](#low-price-pair-filter) act as filters, removing low-value pairs. +[`PrecisionFilter`](#precision-filter) and [`PriceFilter`](#price-pair-filter) act as filters, removing low-value pairs. All pairlists can be chained, and a combination of all pairlists will become your new whitelist. Pairlists are executed in the sequence they are configured. You should always configure either `StaticPairList` or `DynamicPairList` as starting pairlists. @@ -391,7 +391,7 @@ Inactive markets and blacklisted pairs are always removed from the resulting `pa * [`StaticPairList`](#static-pair-list) (default, if not configured differently) * [`VolumePairList`](#volume-pair-list) * [`PrecisionFilter`](#precision-filter) -* [`LowPriceFilter`](#low-price-pair-filter) +* [`PriceFilter`](#price-pair-filter) #### Static Pair List @@ -426,9 +426,10 @@ It uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklis Filters low-value coins which would not allow setting a stoploss. -#### Low Price Pair Filter +#### Price Pair Filter -The `LowPriceFilter` allows filtering of pairs where a raise of 1 price unit is below the `low_price_ratio` ratio. +The `PriceFilter` allows filtering of pairs by price. +Currently, only `low_price_ratio` is implemented, where a raise of 1 price unit (pip) is below the `low_price_ratio` ratio. This option is disabled by default, and will only apply if set to <> 0. Calculation example: @@ -438,7 +439,7 @@ These pairs are dangerous since it may be impossible to place the desired stoplo ### Full Pairlist example -The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, sorting by `quoteVolume` and applies both [`PrecisionFilter`](#precision-filter) and [`LowPriceFilter`](#low-price-pair-filter), filtering all assets where 1 priceunit is > 1%. +The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, sorting by `quoteVolume` and applies both [`PrecisionFilter`](#precision-filter) and [`PriceFilter`](#price-pair-filter), filtering all assets where 1 priceunit is > 1%. ```json "exchange": { @@ -452,7 +453,7 @@ The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, "sort_key": "quoteVolume", }, {"method": "PrecisionFilter"}, - {"method": "LowPriceFilter", "low_price_ratio": 0.01} + {"method": "PriceFilter", "low_price_ratio": 0.01} ], ``` diff --git a/freqtrade/constants.py b/freqtrade/constants.py index c98c32d4c..24e3589fd 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -20,7 +20,7 @@ REQUIRED_ORDERTIF = ['buy', 'sell'] REQUIRED_ORDERTYPES = ['buy', 'sell', 'stoploss', 'stoploss_on_exchange'] ORDERTYPE_POSSIBILITIES = ['limit', 'market'] ORDERTIF_POSSIBILITIES = ['gtc', 'fok', 'ioc'] -AVAILABLE_PAIRLISTS = ['StaticPairList', 'VolumePairList', 'PrecisionFilter', 'LowPriceFilter'] +AVAILABLE_PAIRLISTS = ['StaticPairList', 'VolumePairList', 'PrecisionFilter', 'PriceFilter'] DRY_RUN_WALLET = 999.9 MATH_CLOSE_PREC = 1e-14 # Precision used for float comparisons diff --git a/freqtrade/pairlist/LowPriceFilter.py b/freqtrade/pairlist/PriceFilter.py similarity index 96% rename from freqtrade/pairlist/LowPriceFilter.py rename to freqtrade/pairlist/PriceFilter.py index ff18b97c8..b3546ebd9 100644 --- a/freqtrade/pairlist/LowPriceFilter.py +++ b/freqtrade/pairlist/PriceFilter.py @@ -7,7 +7,7 @@ from freqtrade.pairlist.IPairList import IPairList logger = logging.getLogger(__name__) -class LowPriceFilter(IPairList): +class PriceFilter(IPairList): def __init__(self, exchange, pairlistmanager, config, pairlistconfig: dict, pairlist_pos: int) -> None: @@ -32,7 +32,7 @@ class LowPriceFilter(IPairList): def _validate_ticker_lowprice(self, ticker) -> bool: """ - Check if if one price-step is > than a certain barrier. + Check if if one price-step (pip) is > than a certain barrier. :param ticker: ticker dict as returned from ccxt.load_markets() :param precision: Precision :return: True if the pair can stay, false if it should be removed diff --git a/tests/pairlist/test_pairlist.py b/tests/pairlist/test_pairlist.py index 9daaa5353..76537880c 100644 --- a/tests/pairlist/test_pairlist.py +++ b/tests/pairlist/test_pairlist.py @@ -150,14 +150,14 @@ def test_VolumePairList_refresh_empty(mocker, markets_empty, whitelist_conf): # Precisionfilter bid ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "bidVolume"}, {"method": "PrecisionFilter"}], "BTC", ['FUEL/BTC', 'LTC/BTC', 'TKN/BTC', 'ETH/BTC']), - # Lowpricefilter and VolumePairList + # PriceFilter and VolumePairList ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume"}, - {"method": "LowPriceFilter", "low_price_ratio": 0.03}], + {"method": "PriceFilter", "low_price_ratio": 0.03}], "BTC", ['ETH/BTC', 'TKN/BTC', 'LTC/BTC', 'FUEL/BTC']), # Hot is removed by precision_filter, Fuel by low_price_filter. ([{"method": "VolumePairList", "number_assets": 5, "sort_key": "quoteVolume"}, {"method": "PrecisionFilter"}, - {"method": "LowPriceFilter", "low_price_ratio": 0.02} + {"method": "PriceFilter", "low_price_ratio": 0.02} ], "BTC", ['ETH/BTC', 'TKN/BTC', 'LTC/BTC']), # StaticPairlist Only ([{"method": "StaticPairList"}, @@ -189,7 +189,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, shitcoinmarkets, t if pairlist['method'] == 'PrecisionFilter': assert log_has_re(r'^Removed .* from whitelist, because stop price .* ' r'would be <= stop limit.*', caplog) - if pairlist['method'] == 'LowPriceFilter': + if pairlist['method'] == 'PriceFilter': assert log_has_re(r'^Removed .* from whitelist, because 1 unit is .*%$', caplog)