Improve docs and fix typos

This commit is contained in:
Matthias 2020-11-29 11:36:16 +01:00
parent 768d7fa196
commit 9d6f3a89ef
3 changed files with 14 additions and 2 deletions

View File

@ -94,6 +94,8 @@ Below is an outline of exception inheritance hierarchy:
+---+ StrategyError +---+ StrategyError
``` ```
---
## Plugins ## Plugins
### Pairlists ### Pairlists
@ -203,6 +205,8 @@ The `until` portion should be calculated using the provided `calculate_lock_end(
All Protections should use `"stop_duration"` to define how long a a pair (or all pairs) should be locked. All Protections should use `"stop_duration"` to define how long a a pair (or all pairs) should be locked.
The content of this is made available as `self._stop_duration` to the each Protection. The content of this is made available as `self._stop_duration` to the each Protection.
If your protection requires a look-back period, please use `"lookback_period"` to keep different protections aligned.
#### Global vs. local stops #### Global vs. local stops
Protections can have 2 different ways to stop trading for a limited : Protections can have 2 different ways to stop trading for a limited :
@ -221,6 +225,13 @@ These Protections should do their evaluation across all pairs, and consequently
Global protection must set `has_global_stop=True` to be evaluated for global stops. Global protection must set `has_global_stop=True` to be evaluated for global stops.
The method `global_stop()` will be called whenever a trade closed (sell order completed). The method `global_stop()` will be called whenever a trade closed (sell order completed).
##### Protections - calculating lock end time
Protections should calculate the lock end time based on the last trade it considers.
This avoids relocking should the lookback-period be longer than the actual lock period.
---
## Implement a new Exchange (WIP) ## Implement a new Exchange (WIP)
!!! Note !!! Note

View File

@ -204,8 +204,8 @@ CONF_SCHEMA = {
'properties': { 'properties': {
'method': {'type': 'string', 'enum': AVAILABLE_PROTECTIONS}, 'method': {'type': 'string', 'enum': AVAILABLE_PROTECTIONS},
'stop_duration': {'type': 'number', 'minimum': 0.0}, 'stop_duration': {'type': 'number', 'minimum': 0.0},
'trade_limit': {'type': 'number', 'integer': 1}, 'trade_limit': {'type': 'number', 'minimum': 1},
'lookback_period': {'type': 'number', 'integer': 1}, 'lookback_period': {'type': 'number', 'minimum': 1},
}, },
'required': ['method'], 'required': ['method'],
} }

View File

@ -54,6 +54,7 @@ def test_stoploss_guard(mocker, default_conf, fee, caplog):
default_conf['protections'] = [{ default_conf['protections'] = [{
"method": "StoplossGuard", "method": "StoplossGuard",
"lookback_period": 60, "lookback_period": 60,
"stop_duration": 40,
"trade_limit": 2 "trade_limit": 2
}] }]
freqtrade = get_patched_freqtradebot(mocker, default_conf) freqtrade = get_patched_freqtradebot(mocker, default_conf)