From 77e46ebc561575191b57c6214f771f46b9cb177b Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Fri, 15 Jun 2018 09:59:34 -0700 Subject: [PATCH] revised code --- freqtrade/strategy/interface.py | 21 ++++++--------------- freqtrade/strategy/resolver.py | 1 - 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 6ffd7b981..e9e9e6d7b 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -2,11 +2,11 @@ IStrategy interface This module defines the interface to apply for strategies """ -from typing import Dict -from abc import ABC, abstractmethod - -from pandas import DataFrame import warnings +from typing import Dict + +from abc import ABC +from pandas import DataFrame class IStrategy(ABC): @@ -29,9 +29,6 @@ class IStrategy(ABC): # associated ticker interval ticker_interval: str - # configuration used, just in case the strategy want's to use it for something - config: dict = {} - def populate_indicators(self, dataframe: DataFrame) -> DataFrame: """ Populate indicators that will be used in the Buy and Sell strategy @@ -48,10 +45,7 @@ class IStrategy(ABC): :return: DataFrame with buy column """ warnings.warn("deprecated - please replace this method with advise_buy!", DeprecationWarning) - dataframe.loc[ - ( - ), - 'buy'] = 0 + dataframe.loc[(), 'buy'] = 0 return dataframe def populate_sell_trend(self, dataframe: DataFrame) -> DataFrame: @@ -61,10 +55,7 @@ class IStrategy(ABC): :return: DataFrame with sell column """ warnings.warn("deprecated - please replace this method with advise_sell!", DeprecationWarning) - dataframe.loc[ - ( - ), - 'sell'] = 0 + dataframe.loc[(), 'sell'] = 0 return dataframe def advise_indicators(self, dataframe: DataFrame, pair: str) -> DataFrame: diff --git a/freqtrade/strategy/resolver.py b/freqtrade/strategy/resolver.py index abdfc2223..6244dc4e7 100644 --- a/freqtrade/strategy/resolver.py +++ b/freqtrade/strategy/resolver.py @@ -35,7 +35,6 @@ class StrategyResolver(object): self.strategy: IStrategy = self._load_strategy(strategy_name, extra_dir=config.get('strategy_path')) - self.strategy.config = config # Set attributes # Check if we need to override configuration