rename ttl to refresh_period

This commit is contained in:
Matthias 2019-11-19 06:48:56 +01:00
parent a8855bf795
commit 5f62a9e4d8
4 changed files with 8 additions and 10 deletions

View File

@ -54,11 +54,9 @@
{"method": "StaticPairList"},
{
"method": "VolumePairList",
"config": {
"number_assets": 20,
"sort_key": "quoteVolume",
"ttl": 1800
}
"number_assets": 20,
"sort_key": "quoteVolume",
"refresh_period": 1800
},
{"method": "PrecisionFilter"},
{"method": "PriceFilter", "low_price_ratio": 0.01

View File

@ -411,14 +411,14 @@ It uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklis
`VolumePairList` considers outputs of previous pairlists unless it's the first configured pairlist, it does not consider `pair_whitelist`, but selects the top assets from all available markets (with matching stake-currency) on the exchange.
`ttl` allows setting the period (in seconds), at which the pairlist will be refreshed. Defaults to 1800s (30 minutes).
`refresh_period` allows setting the period (in seconds), at which the pairlist will be refreshed. Defaults to 1800s (30 minutes).
```json
"pairlists": [{
"method": "VolumePairList",
"number_assets": 20,
"sort_key": "quoteVolume",
"ttl": 1800,
"refresh_period": 1800,
],
```

View File

@ -115,7 +115,7 @@ Now, let's step through the methods which require actions:
#### Pairlist configuration
Configuration for PairListProvider is done in the bot configuration file in the element `"pairlist"`.
This Pairlist-object may contain a `"config"` dict with additional configurations for the configured pairlist.
This Pairlist-object may contain configurations with additional configurations for the configured pairlist.
By convention, `"number_assets"` is used to specify the maximum number of pairs to keep in the whitelist. Please follow this to ensure a consistent user experience.
Additional elements can be configured as needed. `VolumePairList` uses `"sort_key"` to specify the sorting value - however feel free to specify whatever is necessary for your great algorithm to be successfull and dynamic.

View File

@ -28,7 +28,7 @@ class VolumePairList(IPairList):
'for "pairlist.config.number_assets"')
self._number_pairs = self._pairlistconfig['number_assets']
self._sort_key = self._pairlistconfig.get('sort_key', 'quoteVolume')
self._ttl = self._pairlistconfig.get('ttl', 1800)
self.refresh_period = self._pairlistconfig.get('refresh_period', 1800)
if not self._exchange.exchange_has('fetchTickers'):
raise OperationalException(
@ -67,7 +67,7 @@ class VolumePairList(IPairList):
:return: new whitelist
"""
# Generate dynamic whitelist
if self._last_refresh + self._ttl < datetime.now().timestamp():
if self._last_refresh + self.refresh_period < datetime.now().timestamp():
self._last_refresh = int(datetime.now().timestamp())
return self._gen_pair_whitelist(pairlist,
tickers,