# Source: generated via dynamic_strategy_generator from freqtrade.strategy import IStrategy from pandas import DataFrame import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib class ACO_1_12(IStrategy): timeframe = '1h' # Standard ROI and Stoploss minimal_roi = {"0": 0.1, "60": 0.05, "120": 0.0} stoploss = -0.05 def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['roc'] = ta.ROC(dataframe, timeperiod=10) dataframe['dema'] = ta.DEMA(dataframe, timeperiod=10) dataframe['natr'] = ta.NATR(dataframe, timeperiod=14) dataframe['mom'] = ta.MOM(dataframe, timeperiod=5) dataframe['aroonosc'] = ta.AROONOSC(dataframe, timeperiod=10) dataframe['obv'] = ta.OBV(dataframe) dataframe['obv_sma'] = ta.SMA(dataframe, timeperiod=10, price='obv') return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( qtpylib.crossed_above(dataframe['roc'], 0) ) & ( qtpylib.crossed_above(dataframe['close'], dataframe['dema']) ) & ( (dataframe['natr'] > 3.0) ), 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( qtpylib.crossed_below(dataframe['mom'], 0) ) & ( qtpylib.crossed_below(dataframe['roc'], 0) ) & ( qtpylib.crossed_below(dataframe['aroonosc'], 0) ) & ( qtpylib.crossed_below(dataframe['obv'], dataframe['obv_sma']) ), 'exit_long'] = 1 return dataframe