revised code
This commit is contained in:
parent
179b10e6e7
commit
77e46ebc56
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user