Implement first stop method

This commit is contained in:
Matthias
2020-10-14 07:40:44 +02:00
parent a0bd2ce837
commit 3447f1ae53
6 changed files with 112 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
import logging
from abc import ABC, abstractmethod
from datetime import datetime
from typing import Any, Dict
@@ -9,8 +10,9 @@ logger = logging.getLogger(__name__)
class IProtection(ABC):
def __init__(self, config: Dict[str, Any]) -> None:
def __init__(self, config: Dict[str, Any], protection_config: Dict[str, Any]) -> None:
self._config = config
self._protection_config = protection_config
@property
def name(self) -> str:
@@ -22,3 +24,10 @@ class IProtection(ABC):
Short method description - used for startup-messages
-> Please overwrite in subclasses
"""
@abstractmethod
def stop_trade_enters_global(self, date_now: datetime) -> bool:
"""
Stops trading (position entering) for all pairs
This must evaluate to true for the whole period of the "cooldown period".
"""