The AverageStrategy is a trading strategy that buys and sells assets based on crossover signals. It is a proof of concept strategy and may not perform well in practice. The strategy uses the following indicators:
Moving Average Convergence Divergence (MACD)
Exponential Moving Average (EMA) with a short time period (8) and a medium time period (21)
During the population of indicators, the strategy calculates the MACD and adds two moving averages (maShort and maMedium) to the dataframe.
For the buy signal, the strategy looks for a crossover where the maShort crosses above the maMedium.
For the sell signal, the strategy looks for a crossover where the maMedium crosses above the maShort.
The strategy defines a minimal return on investment (ROI) of 0.5 and a stop loss of -0.2. These values can be overridden in the strategy's configuration file. The strategy is designed to be used with a ticker interval of 4 hours. Please note that this strategy is not optimized for profitability and serves as a demonstration rather than a robust trading strategy.