This strategy is named RSI & CCI Combination Quantitative Trading Strategy. It mainly uses the combination of RSI indicator and CCI indicator to judge the overbought/oversold status in the market and capture reversal opportunities. Specifically, the strategy calculates the buy and sell signals of RSI, combined with CCI indicator’s trading signals, to set up the long and short entry rules. When the entry rules are met, corresponding long or short positions will be opened.
The core logic of this strategy is to utilize both the statistical properties of RSI indicator and CCI indicator to determine whether the market is currently in an overbought or oversold state.
Firstly, the RSI part. The RSI indicator can reflect the overbought/oversold phenomena in the market. RSI greater than 70 is typically considered overbought, while less than 30 is oversold. This strategy sets two RSI indicators, a long-term RSI with default 14 periods, and a short-term RSI with 12 periods. The long-term RSI judges overall trend, while the short-term RSI tracks more sensitive turning points. When both RSI lines indicate the same direction (such as double overbought or double oversold), it means the market is in a significant imbalanced state, which provides best reversal opportunities.
Secondly, the CCI part. The CCI indicator can also be used to identify overbought/oversold levels. CCI higher than 100 is considered overbought, while lower than -100 is oversold. This strategy utilizes this characteristic of CCI to set up entry rules: when CCI signal is consistent with the RSI indicator, the entry signal indicated by RSI will be executed.
Specifically, the entry rules are:
Long entry: when RSI shows oversold area (both long and short term RSI below 30), and CCI is lower than -100, go long.
Short entry: when RSI shows overbought area (both long and short term RSI above 70), and CCI is higher than 100, go short.
By the joint judgment of RSI and CCI, overbought/oversold zones can be effectively confirmed, hence enhancing the stability and profitability of the strategy.
The biggest advantage of this strategy lies in the simultaneous use of both RSI and CCI statistical patterns to identify overbought/oversold signals more precisely, which provides ideal turning points to capture reversals. The concrete advantages include:
The major risk of this strategy is that the overbought/oversold signals indicated by RSI and CCI may not completely reflect the real reversal timing. The concrete risks include:
Corresponding solutions include:
The strategy can be further optimized in actual trading, mainly:
Through tests and optimizations, expectancy of the strategy’s profitability and stability could be further improved.
The strategy belongs to a typical reversal capturing strategy. By combining two commonly used indicators, RSI and CCI, it judges overbought/oversold levels and sets up corresponding entry rules, forming a simple practical short term trading strategy. The biggest advantage is that the joint use of the two indicators makes signal judgment more accurate, avoiding fake reversals, and grasps the best timing for reversals. Of course risks exist, requiring optimizations in indicators themselves, stop loss strategies, and collaborating with trend analysis. Overall speaking, it provides beginners a simple reliable quant approach, worth learning and practicing.
/*backtest start: 2023-12-22 00:00:00 end: 2024-01-21 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 //Author: RvZ14 //Based on Joseph Nemeth MACD+CCI strategy //Reference reading: https://sites.google.com/site/forexjosephnemeth/home/macd-cci strategy(title="MACD+CCI Strategy", shorttitle="macd/cci") length = input(14, minval=1) fastLength = input(12, minval=1), slowLength=input(26,minval=1) signalLength=input(2,minval=1) src = input(close, title="CCI Source") //cci ma = sma(src, length) cci = (src - ma) / (0.015 * dev(src, length)) plot(cci, title = "cci", color=#5DADE2,linewidth = 1,transp = 0) band1 = hline(100, color=gray, linewidth = 1) band0 = hline(-100, color=gray, linewidth = 1) fill(band1, band0, color= #F9E79F) //macd source = close fastMA = ema(source, fastLength) slowMA = ema(source, slowLength) macd = fastMA - slowMA signal = ema(macd, signalLength) hist = macd - signal plot(hist, color=#EC7063, style=histogram) plot(macd, title = "macd", color=#5DADE2, linewidth = 1,transp = 0) plot(signal, title = "signal", color=#F5B041,linewidth = 1,transp = 0) longCond = cci > 100 and macd > 0 or cci > -100 and macd < 0 shortCond = cci < -100 and macd < 0 or cci < 100 and macd > 0 strategy.entry("long",strategy.long,when = longCond == true) strategy.entry("short",strategy.short,when=shortCond == true)template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6