The "ReinforcedAverageStrategy" is a trading strategy implemented in Python for backtesting purposes. Here is a brief description of what the strategy does:
The strategy is designed to buy and sell assets based on crossover signals generated by moving average indicators. It uses two exponential moving averages (EMAs) to identify potential buying and selling opportunities.
The shorter EMA is calculated using a time period of 8, while the longer EMA is calculated using a time period of 21.
Additionally, the strategy uses Bollinger Bands as a visual representation of price volatility.
The strategy has a minimal return on investment (ROI) of 0.5, meaning it aims for a 50% gain on each trade. The stop loss is set at -0.2, indicating that if the price drops by 20% from the entry point, the asset will be sold to limit losses. The ticker interval for the strategy is set to 4 hours, meaning it operates on 4-hour candlestick data. The strategy performs a resampling of the input dataframe to establish the trend (uptrend, downtrend, or sideways) using a reinforcement logic. The resampling is done by aggregating the data into a higher time frame (e.g., from 1-minute to 4-hour) and calculating a simple moving average (SMA) of 50 periods on the resampled data. The buy signal is generated when the shorter EMA crosses above the longer EMA and the closing price is higher than the resampled SMA. The sell signal is generated when the shorter EMA crosses above the longer EMA. The strategy makes use of various technical analysis indicators from the TA-Lib and freqtrade libraries. Please note that this strategy is described as a proof of concept and may not perform well in actual trading scenarios.