The ReinforcedAverageStrategy is a trading strategy implemented in Python using the Freqtrade library. The strategy is designed to buy and sell based on crossovers of moving averages. However, it is mentioned that this strategy doesn't perform well and is just a proof of concept.
Here is a breakdown of the strategy's important components:
The strategy uses the MACD indicator and calculates two exponential moving averages (EMA) called "maShort" and "maMedium" with different time periods.
It also calculates Bollinger Bands for graphing purposes.
The strategy defines a method called "populate_buy_trend" that populates the buy signal for the given dataframe. It checks for a crossover condition where the "maShort" crosses above the "maMedium" and the close price is higher than the resampled simple moving average. The strategy defines a method called "populate_sell_trend" that populates the sell signal for the given dataframe. It checks for a crossover condition where the "maMedium" crosses above the "maShort". The strategy includes a method called "resample" that resamples the dataframe to establish the trend using a reinforcement logic. It resamples the dataframe based on a specified interval and factor, calculates OHLC (open, high, low, close) values, calculates a resampled simple moving average, and merges the resampled data back into the original dataframe. Overall, the ReinforcedAverageStrategy is a simple strategy that uses moving average crossovers to generate buy and sell signals. However, as mentioned, it is not expected to perform well in actual trading and is primarily a proof of concept.