Add first version of protection manager
This commit is contained in:
2
freqtrade/plugins/protections/__init__.py
Normal file
2
freqtrade/plugins/protections/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# flake8: noqa: F401
|
||||
from freqtrade.plugins.protections.iprotection import IProtection
|
24
freqtrade/plugins/protections/iprotection.py
Normal file
24
freqtrade/plugins/protections/iprotection.py
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IProtection(ABC):
|
||||
|
||||
def __init__(self, config: Dict[str, Any]) -> None:
|
||||
self._config = config
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
return self.__class__.__name__
|
||||
|
||||
@abstractmethod
|
||||
def short_desc(self) -> str:
|
||||
"""
|
||||
Short method description - used for startup-messages
|
||||
-> Please overwrite in subclasses
|
||||
"""
|
Reference in New Issue
Block a user