The "MacdCciCrossedStrategy" is a trading strategy that combines two technical indicators: Moving Average Convergence Divergence (MACD) and Commodity Channel Index (CCI). The strategy aims to generate buy and sell signals based on the crossover of MACD and CCI values. In this strategy, the MACD indicator is calculated using the fast period, slow period, and signal period parameters.
The MACD line, MACD signal line, and MACD histogram are added to the dataframe.
The CCI indicator is also calculated and added to the dataframe.
For generating buy signals, the strategy looks for instances where the MACD line crosses above the MACD signal line and the CCI value is below -50.0. When these conditions are met, a buy signal is indicated in the dataframe. For generating sell signals, the strategy looks for instances where the MACD line crosses below the MACD signal line and the CCI value is above 100.0. When these conditions are met, a sell signal is indicated in the dataframe. The strategy specifies a minimal return on investment (ROI) for the trades, with different target returns depending on the holding period. It also sets an optimal stop loss level to limit potential losses. The strategy operates on a 5-minute timeframe and provides parameters for optimizing the MACD periods during backtesting. Overall, the strategy aims to capture potential trends in the market by combining the signals from MACD and CCI indicators, allowing users to backtest its performance on various trading pairs.