# 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_14_10(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) macd = ta.MACD(dataframe, fastperiod=19, slowperiod=39, signalperiod=9) dataframe['macd'] = macd['macd'] dataframe['macdsignal'] = macd['macdsignal'] dataframe['macdhist'] = macd['macdhist'] dataframe['ppo'] = ta.PPO(dataframe, fastperiod=12, slowperiod=26) dataframe['ad'] = ta.AD(dataframe) dataframe['ad_sma'] = ta.SMA(dataframe, timeperiod=10, price='ad') stoch = ta.STOCH(dataframe, fastk_period=21, slowk_period=5, slowd_period=5) dataframe['slowk'] = stoch['slowk'] dataframe['slowd'] = stoch['slowd'] dataframe['cci'] = ta.CCI(dataframe, timeperiod=7) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['rsi'] < 35) ) & ( qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) ) & ( qtpylib.crossed_above(dataframe['ppo'], 0) ) & ( qtpylib.crossed_above(dataframe['ad'], dataframe['ad_sma']) ), 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['slowk'] > 75) ) & ( (dataframe['cci'] > 80) ), 'exit_long'] = 1 return dataframe