The AlligatorStrategy is a trading strategy implemented as a class that inherits from the IStrategy interface. It utilizes various technical analysis (TA) indicators to make buy and sell decisions based on the given DataFrame of exchange data. The strategy consists of three main methods:
populate_indicators: This method calculates and adds several TA indicators to the DataFrame.
The indicators used in this strategy are:
Stochastic RSI (stoch_rsi)
Exponential Moving Averages (ema7, ema30, ema50, ema100, ema121, ema200)
populate_buy_trend: This method populates the "buy" column in the DataFrame based on the values of the TA indicators.
The conditions for generating a buy signal are:
ema7 > ema30 > ema50 > ema100 > ema121 > ema200
stoch_rsi < self.buy_stoch_rsi.value (buy_stoch_rsi is a parameter of the strategy)
volume > 0
populate_sell_trend: This method populates the "sell" column in the DataFrame based on the values of the TA indicators.
The conditions for generating a sell signal are:
ema121 > ema7
stoch_rsi > self.sell_stoch_rsi.value (sell_stoch_rsi is a parameter of the strategy)
volume > 0
By using these indicators and their respective conditions, the strategy aims to identify potential buying and selling opportunities in the market. The buy and sell signals generated by the strategy can be used for backtesting and evaluating its performance.