Add stoploss per pair support

This commit is contained in:
Matthias
2020-11-25 11:11:55 +01:00
parent dcdf4a0503
commit dce2364672
3 changed files with 64 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ class StoplossGuard(IProtection):
self._lookback_period = protection_config.get('lookback_period', 60)
self._trade_limit = protection_config.get('trade_limit', 10)
self._stop_duration = protection_config.get('stop_duration', 60)
self._disable_global_stop = protection_config.get('only_per_pair', False)
def short_desc(self) -> str:
"""
@@ -72,6 +73,8 @@ class StoplossGuard(IProtection):
:return: Tuple of [bool, until, reason].
If true, all pairs will be locked with <reason> until <until>
"""
if self._disable_global_stop:
return False, None, None
return self._stoploss_guard(date_now, None)
def stop_per_pair(self, pair: str, date_now: datetime) -> ProtectionReturn: