# 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_2(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['rsi'] = ta.RSI(dataframe, timeperiod=21) dataframe['willr'] = ta.WILLR(dataframe, timeperiod=14) dataframe['cmo'] = ta.CMO(dataframe, timeperiod=14) dataframe['trix'] = ta.TRIX(dataframe, timeperiod=9) dataframe['natr'] = ta.NATR(dataframe, timeperiod=14) stoch = ta.STOCH(dataframe, fastk_period=5, slowk_period=3, slowd_period=3) dataframe['slowk'] = stoch['slowk'] dataframe['slowd'] = stoch['slowd'] dataframe['kama'] = ta.KAMA(dataframe, timeperiod=30) dataframe['atr'] = ta.ATR(dataframe, timeperiod=14) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['rsi'] < 35) ) & ( (dataframe['willr'] < -80) ) & ( (dataframe['cmo'] < -50) ) & ( qtpylib.crossed_above(dataframe['trix'], 0) ) & ( (dataframe['natr'] > 1.5) ), 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['slowk'] > 85) ) & ( qtpylib.crossed_below(dataframe['close'], dataframe['kama']) ), 'exit_long'] = 1 return dataframe