From 9f8539f13e05f35b3130d2d6f9d6d7ef60b8f8ae Mon Sep 17 00:00:00 2001 From: Gerald Lonlas Date: Sun, 28 Jan 2018 13:21:25 -0800 Subject: [PATCH] Remove unused code on Strategy interface --- freqtrade/strategy/interface.py | 7 ------- freqtrade/strategy/strategy.py | 14 ++++---------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 9281e72ca..dc9f33244 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -17,13 +17,6 @@ class IStrategy(ABC): stoploss -> float: optimal stoploss designed for the strategy ticker_interval -> int: value of the ticker interval to use for the strategy """ - @property - def name(self) -> str: - """ - Name of the strategy. - :return: str representation of the class name - """ - return self.__class__.__name__ @abstractmethod def populate_indicators(self, dataframe: DataFrame) -> DataFrame: diff --git a/freqtrade/strategy/strategy.py b/freqtrade/strategy/strategy.py index 97e260ee8..427c24fc6 100644 --- a/freqtrade/strategy/strategy.py +++ b/freqtrade/strategy/strategy.py @@ -1,3 +1,5 @@ +# pragma pylint: disable=attribute-defined-outside-init + """ This module load custom strategies """ @@ -21,7 +23,7 @@ class Strategy(object): DEFAULT_STRATEGY = 'default_strategy' - def __new__(cls): + def __new__(cls) -> object: """ Used to create the Singleton :return: Strategy object @@ -30,15 +32,7 @@ class Strategy(object): Strategy.__instance = object.__new__(cls) return Strategy.__instance - def __init__(self): - if Strategy.__instance is None: - self.logger = None - self.minimal_roi = None - self.stoploss = None - self.ticker_interval = None - self.custom_strategy = None - - def init(self, config): + def init(self, config: dict) -> None: """ Load the custom class from config parameter :param config: