You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/includes/pairlists.md
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Pairlist Handlers define the list of pairs (pairlist) that the bot should trade.
4
4
5
5
In your configuration, you can use Static Pairlist (defined by the [`StaticPairList`](#static-pair-list) Pairlist Handler) and Dynamic Pairlist (defined by the [`VolumePairList`](#volume-pair-list) and [`PercentChangePairList`](#percent-change-pair-list) Pairlist Handlers).
6
6
7
-
Additionally, [`AgeFilter`](#agefilter), [`PrecisionFilter`](#precisionfilter), [`PriceFilter`](#pricefilter), [`ShuffleFilter`](#shufflefilter), [`SpreadFilter`](#spreadfilter) and [`VolatilityFilter`](#volatilityfilter) act as Pairlist Filters, removing certain pairs and/or moving their positions in the pairlist.
7
+
Additionally, [`AgeFilter`](#agefilter), [`DelistFilter`](#delistfilter), [`PrecisionFilter`](#precisionfilter), [`PriceFilter`](#pricefilter), [`ShuffleFilter`](#shufflefilter), [`SpreadFilter`](#spreadfilter) and [`VolatilityFilter`](#volatilityfilter) act as Pairlist Filters, removing certain pairs and/or moving their positions in the pairlist.
8
8
9
9
If multiple Pairlist Handlers are used, they are chained and a combination of all Pairlist Handlers forms the resulting pairlist the bot uses for trading and backtesting. Pairlist Handlers are executed in the sequence they are configured. You can define either `StaticPairList`, `VolumePairList`, `ProducerPairList`, `RemotePairList`, `MarketCapPairList` or `PercentChangePairList` as the starting Pairlist Handler.
10
10
@@ -27,6 +27,7 @@ You may also use something like `.*DOWN/BTC` or `.*UP/BTC` to exclude leveraged
27
27
*[`RemotePairList`](#remotepairlist)
28
28
*[`MarketCapPairList`](#marketcappairlist)
29
29
*[`AgeFilter`](#agefilter)
30
+
*[`DelistFilter`](#delistfilter)
30
31
*[`FullTradesFilter`](#fulltradesfilter)
31
32
*[`OffsetFilter`](#offsetfilter)
32
33
*[`PerformanceFilter`](#performancefilter)
@@ -180,7 +181,7 @@ More sophisticated approach can be used, by using `lookback_timeframe` for candl
180
181
*`refresh_period`: Defines the interval (in seconds) at which the pairlist will be refreshed. The default is 1800 seconds (30 minutes).
181
182
*`lookback_days`: Number of days to look back. When `lookback_days` is selected, the `lookback_timeframe` is defaulted to 1 day.
182
183
*`lookback_timeframe`: Timeframe to use for the lookback period.
183
-
*`lookback_period`: Number of periods to look back at.
184
+
*`lookback_period`: Number of periods to look back at.
184
185
185
186
When PercentChangePairList is used after other Pairlist Handlers, it will operate on the outputs of those handlers. If it is the leading Pairlist Handler, it will select pairs from all available markets with the specified stake currency.
186
187
@@ -270,7 +271,6 @@ You can limit the length of the pairlist with the optional parameter `number_ass
270
271
],
271
272
```
272
273
273
-
274
274
!!! Tip "Combining pairlists"
275
275
This pairlist can be combined with all other pairlists and filters for further pairlist reduction, and can also act as an "additional" pairlist, on top of already defined pairs.
276
276
`ProducerPairList` can also be used multiple times in sequence, combining the pairs from multiple producers.
@@ -312,7 +312,7 @@ The `pairlist_url` option specifies the URL of the remote server where the pairl
312
312
The `save_to_file` option, when provided with a valid filename, saves the processed pairlist to that file in JSON format. This option is optional, and by default, the pairlist is not saved to a file.
313
313
314
314
??? Example "Multi bot with shared pairlist example"
315
-
315
+
316
316
`save_to_file` can be used to save the pairlist to a file with Bot1:
317
317
318
318
```json
@@ -407,6 +407,16 @@ be caught out buying before the pair has finished dropping in price.
407
407
408
408
This filter allows freqtrade to ignore pairs until they have been listed for at least `min_days_listed` days and listed before `max_days_listed`.
409
409
410
+
#### DelistFilter
411
+
412
+
Removes pairs that will be delisted on the exchange maximum `max_days_from_now` days from now (defaults to `0` which remove all future delisted pairs no matter how far from now). Currently this filter only supports following exchanges:
413
+
414
+
!!! Note "Available exchanges"
415
+
Delist filter is only available on Binance, where Binance Futures will work for both dry and live modes, while Binance Spot is limited to live mode (for technical reasons).
416
+
417
+
!!! Warning "Backtesting"
418
+
`DelistFilter` does not support backtesting mode.
419
+
410
420
#### FullTradesFilter
411
421
412
422
Shrink whitelist to consist only in-trade pairs when the trade slots are full (when `max_open_trades` isn't being set to `-1` in the config).
@@ -438,7 +448,7 @@ Example to remove the first 10 pairs from the pairlist, and takes the next 20 (t
438
448
```
439
449
440
450
!!! Warning
441
-
When `OffsetFilter` is used to split a larger pairlist among multiple bots in combination with `VolumeFilter`
451
+
When `OffsetFilter` is used to split a larger pairlist among multiple bots in combination with `VolumeFilter`
442
452
it can not be guaranteed that pairs won't overlap due to slightly different refresh intervals for the
443
453
`VolumeFilter`.
444
454
@@ -601,7 +611,7 @@ Adding `"sort_direction": "asc"` or `"sort_direction": "desc"` enables sorting m
601
611
602
612
### Full example of Pairlist Handlers
603
613
604
-
The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, sorting pairs by `quoteVolume`and applies [`PrecisionFilter`](#precisionfilter) and [`PriceFilter`](#pricefilter), filtering all assets where 1 price unit is > 1%. Then the [`SpreadFilter`](#spreadfilter) and [`VolatilityFilter`](#volatilityfilter)is applied and pairs are finally shuffled with the random seed set to some predefined value.
614
+
The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets, sorting pairs by `quoteVolume`, then filter future delisted pairs using [`DelistFilter`](#delistfilter)and [`AgeFilter`](#agefilter) to remove pairs that are listed less than 10 days ago. After that [`PrecisionFilter`](#precisionfilter) and [`PriceFilter`](#pricefilter) are applied, filtering all assets where 1 price unit is > 1%. Then the [`SpreadFilter`](#spreadfilter) and [`VolatilityFilter`](#volatilityfilter)are applied and pairs are finally shuffled with the random seed set to some predefined value.
605
615
606
616
```json
607
617
"exchange": {
@@ -614,6 +624,10 @@ The below example blacklists `BNB/BTC`, uses `VolumePairList` with `20` assets,
Copy file name to clipboardExpand all lines: docs/strategy-customization.md
+24-6Lines changed: 24 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ Check the [configuration documentation](configuration.md) about how to set the b
84
84
**Always use dry mode when testing as this gives you an idea of how your strategy will work in reality without risking capital.**
85
85
86
86
## Diving in deeper
87
+
87
88
**For the following section we will use the [user_data/strategies/sample_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/templates/sample_strategy.py)
88
89
file as reference.**
89
90
@@ -99,9 +100,9 @@ file as reference.**
99
100
Some common patterns for this are listed in the [Common Mistakes](#common-mistakes-when-developing-strategies) section of this document.
100
101
101
102
??? Hint "Lookahead and recursive analysis"
102
-
Freqtrade includes two helpful commands to help assess common lookahead (using future data) and
103
-
recursive bias (variance in indicator values) issues. Before running a strategy in dry or live more,
104
-
you should always use these commands first. Please check the relevant documentation for
103
+
Freqtrade includes two helpful commands to help assess common lookahead (using future data) and
104
+
recursive bias (variance in indicator values) issues. Before running a strategy in dry or live more,
105
+
you should always use these commands first. Please check the relevant documentation for
105
106
[lookahead](lookahead-analysis.md) and [recursive](recursive-analysis.md) analysis.
106
107
107
108
### Dataframe
@@ -154,7 +155,7 @@ Vectorized operations perform calculations across the whole range of data and ar
154
155
155
156
!!! Warning "Trade order assumptions"
156
157
In backtesting, signals are generated on candle close. Trades are then initiated immeditely on next candle open.
157
-
158
+
158
159
In dry and live, this may be delayed due to all pair dataframes needing to be analysed first, then trade processing
159
160
for each of those pairs happens. This means that in dry/live you need to be mindful of having as low a computation
160
161
delay as possible, usually by running a low number of pairs and having a CPU with a good clock speed.
@@ -284,7 +285,7 @@ It's important to always return the dataframe without removing/modifying the col
284
285
285
286
This method will also define a new column, `"enter_long"` (`"enter_short"` for shorts), which needs to contain `1` for entries, and `0` for "no action". `enter_long` is a mandatory column that must be set even if the strategy is shorting only.
286
287
287
-
You can name your entry signals by using the `"enter_tag"` column, which can help debug and assess your strategy later.
288
+
You can name your entry signals by using the `"enter_tag"` column, which can help debug and assess your strategy later.
288
289
289
290
Sample from `user_data/strategies/sample_strategy.py`:
290
291
@@ -555,7 +556,7 @@ A full sample can be found [in the DataProvider section](#complete-dataprovider-
555
556
556
557
??? Note "Alternative candle types"
557
558
Informative_pairs can also provide a 3rd tuple element defining the candle type explicitly.
558
-
Availability of alternative candle-types will depend on the trading-mode and the exchange.
559
+
Availability of alternative candle-types will depend on the trading-mode and the exchange.
559
560
In general, spot pairs cannot be used in futures markets, and futures candles can't be used as informative pairs for spot bots.
560
561
Details about this may vary, if they do, this can be found in the exchange documentation.
561
562
@@ -783,6 +784,7 @@ Please always check the mode of operation to select the correct method to get da
783
784
-`ohlcv(pair, timeframe)` - Currently cached candle (OHLCV) data for the pair, returns DataFrame or empty DataFrame.
784
785
-[`orderbook(pair, maximum)`](#orderbookpair-maximum) - Returns latest orderbook data for the pair, a dict with bids/asks with a total of `maximum` entries.
785
786
-[`ticker(pair)`](#tickerpair) - Returns current ticker data for the pair. See [ccxt documentation](https://github.com/ccxt/ccxt/wiki/Manual#price-tickers) for more details on the Ticker data structure.
787
+
-[`check_delisting(pair)`](#check_delistingpair) - Return Datetime of the pair delisting schedule if any, otherwise return None
786
788
-[`funding_rate(pair)`](#funding_ratepair) - Returns current funding rate data for the pair.
787
789
-`runmode` - Property containing the current runmode.
788
790
@@ -906,6 +908,22 @@ if self.dp.runmode.value in ('live', 'dry_run'):
906
908
!!! Warning "Warning about backtesting"
907
909
This method will always return up-to-date / real-time values. As such, usage during backtesting / hyperopt without runmode checks will lead to wrong results, e.g. your whole dataframe will contain the same single value in all rows.
This method is only available for certain exchanges and will return `None` in cases this is not available or if the pair is not scheduled for delisting.
923
+
924
+
!!! Warning "Warning about backtesting"
925
+
This method will always return up-to-date / real-time values. As such, usage during backtesting / hyperopt without runmode checks will lead to wrong results, e.g. your whole dataframe will contain the same single value in all rows.
926
+
909
927
### *funding_rate(pair)*
910
928
911
929
Retrieves the current funding rate for the pair and only works for futures pairs in the format of `base/quote:settle` (e.g. `ETH/USDT:USDT`).
0 commit comments