Implement first stop method
This commit is contained in:
@@ -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".
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user