The MACDStrategy is a trading strategy that uses technical indicators to identify uptrends and downtrends in the market. The main indicators used are the Moving Average Convergence Divergence (MACD) and the Commodity Channel Index (CCI). The strategy defines an uptrend when the MACD line is above the MACD signal line and the CCI is below -50.
This indicates a potential buying opportunity.
On the other hand, a downtrend is defined when the MACD line is below the MACD signal line and the CCI is above 100.
This indicates a potential selling opportunity. The strategy sets specific parameters for minimal ROI (Return on Investment) and stop loss. These parameters can be adjusted in the strategy's configuration file. The minimal ROI is defined for different time intervals, such as 60, 30, 20, and 0 minutes. The stop loss is set at -0.3, indicating a maximum acceptable loss. The strategy uses a ticker interval of 5 minutes, meaning it operates on 5-minute intervals of market data. In terms of implementation, the strategy populates various indicators on the input DataFrame, including the MACD line, MACD signal line, MACD histogram, and CCI. It then populates the buy signal column based on the conditions mentioned earlier. Similarly, it populates the sell signal column based on its sell conditions. Overall, the MACDStrategy aims to generate trading signals based on the MACD and CCI indicators, allowing users to backtest this strategy on their preferred trading instruments.