The TEMABounce strategy is a trading strategy that uses various technical indicators to generate buy and sell signals. Here is a brief description of what the strategy does:
In the populate_indicators method:
It calculates the RSI (Relative Strength Index) indicator. It calculates the MACD (Moving Average Convergence Divergence) indicator, including the MACD line, signal line, and histogram.
It calculates the Bollinger Bands indicator, including the lower band, middle band, upper band, percentage outside the bands, width of the bands, and gain from the upper band to the closing price.
It calculates the TEMA (Triple Exponential Moving Average) indicator with both long and short periods.
It calculates the slope of the TEMA short period and normalizes it. It calculates the difference between the TEMA and the closing price, normalized by the closing price. It calculates the simple moving average (SMA) indicator. It calculates the SAR (Stop and Reverse) indicator. In the populate_buy_trend method:
It sets up conditions for the buy signal based on the indicators. If enabled, it checks for a positive MACD histogram. It checks for a positive TEMA difference. If enabled, it checks for a positive Bollinger Bands gain. It checks for a positive crossover of the TEMA angle. If any of the conditions are met, it sets the 'buy' column to 1. In the populate_sell_trend method:
It sets up conditions for the sell signal based on the indicators. If enabled, it checks for a negative crossover of the TEMA angle. It checks if the closing price is above the TEMA. It checks for a minimum TEMA difference. If any of the conditions are met, it sets the 'sell' column to 1.