The FrankenStrat strategy is a backtesting strategy that aims to identify buying and selling opportunities in trading. Here's a brief description of what the strategy does:
In the method populate_indicators, the strategy calculates various indicators based on the provided dataframe and metadata. It merges informative data from a 1-hour timeframe and populates indicators for the normal timeframe.
In the method populate_buy_trend, the strategy determines the conditions for buying.
The following conditions are checked:
If the closing price is below a certain moving average multiplied by a low offset, and the EWO (Elliott Wave Oscillator) is greater than -1, and the volume is greater than 0.
OR
If the closing price is below a TEMA (Triple Exponential Moving Average) multiplied by a TEMA low offset, and the EWO is greater than -1, and the volume is greater than 0. OR
If the closing price is above the 200-day exponential moving average (ema_200) and the 1-hour exponential moving average (ema_200_1h), and below the "ema_slow," and below 0.99 times the lower Bollinger Band (bb_lowerband), and the slow volume mean is greater than 40% of the volume mean shifted by 30 periods, and the volume is greater than 0. OR
If the closing price is below the "ema_slow," and below 0.975 times the lower Bollinger Band (bb_lowerband), and the volume is less than 4 times the previous volume, and the 1-hour RSI (Relative Strength Index) is less than 15, and the slow volume mean is greater than 40% of the volume mean shifted by 30 periods, and the volume is greater than 0. OR
If the closing price is above the 200-day exponential moving average (ema_200) and the 1-hour exponential moving average (ema_200_1h), and the 26-day exponential moving average (ema_26) is above the 12-day exponential moving average (ema_12), and the difference between ema_26 and ema_12 is greater than 2% of the opening price, and the difference between the shifted ema_26 and ema_12 is greater than the opening price divided by 100, and the volume is less than 4 times the previous volume, and the closing price is below the lower Bollinger Band (bb_lowerband), and the slow volume mean is greater than 40% of the volume mean shifted by 30 periods, and the volume is greater than 0. OR
If the 26-day exponential moving average (ema_26) is above the 12-day exponential moving average (ema_12), and the difference between ema_26 and ema_12 is greater than 3% of the opening price, and the difference between the shifted ema_26 and ema_12 is greater than the opening price divided by 100, and the volume is less than 4 times the previous volume, and the closing price is below the lower Bollinger Band (bb_lowerband), and the volume is greater than 0. OR
If the closing price is below the 5-day simple moving average (sma_5), and the SSL up indicator on the 1-hour timeframe (ssl_up_1h) is greater than the SSL down indicator on the 1-hour timeframe (ssl_down_1h), and the "ema_slow" is greater than the 200-day exponential moving average (ema_200), and the 50-day exponential moving average on the 1-hour