Strategy vault / Mean reversion
Dual Indicator Reversal Trading Strategy
This strategy combines the 123 reversal pattern with the CCI indicator to create a cumulative signal short term trading strategy. It capitalizes on price reversals by blending chart pattern analysis with…
Overview
This strategy combines the 123 reversal pattern with the CCI indicator to create a cumulative signal short term trading strategy. It capitalizes on price reversals by blending chart pattern analysis with overbought/oversold indications. The strategy suits trading instruments like indices and forex that experience oscillations.
Strategy Logic
The key trading logic involves:
123 pattern identifies reversals. 2 consecutive days of closing price reversal along with Stochastic reversal gives signals.
CCI confirms reversals. CCI identifies overbought/oversold conditions. Crossover of fast and slow CCI suggests reversals.
123 + CCI together create more robust cumulative signals. Trades only when both reverse together.
Option to reverse signal direction. Go short on long signals and vice versa for contrarian trading.
Stochastic settings control reversal sensitivity. CCI parameters dictate overbought/oversold perception.
No fixed take profit or stop loss. Exits based on reversal patterns.
The strategy combines price action and index analysis for high probability reversal trade setups. Also offers flexibility via contrarian trade selection.
Advantages
The main advantages are:
Dual indicator filtering improves signal quality and avoids false breaks.
123 patterns are intuitive and reliable for spotting reversals.
CCI clearly identifies overbought/oversold zones to time reversals.
Flexibility via contrarian trade selection for diversification.
Simple parameters make it easy to use.
No stop loss or take profit needed reduces risk.
Suits oscillating instruments like indices and forex.
Easy to replicate for beginners.
Risks
The major risks are:
Increased costs from higher trade frequency.
Failed reversal risk since patterns are not foolproof.
Instrument selection risk if applied on trending assets.
Parameter optimization risk leading to curve fitting.
Missing the trend risk and trading counter trend.
Low efficiency risk as reversal opportunities can be limited.
Risks can be mitigated through frequency control, asset selection, backtesting and parameter optimization.
Enhancement Opportunities
Some ways to improve the strategy:
Add stop loss and take profit for risk control.
Incorporate trend filters to avoid false breaks.
Optimize parameters for different instruments.
Introduce position sizing based on conditions.
Set drawdown limits to prevent sustained losses.
Add machine learning for adaptive optimization.
Refine for higher win rate and risk-reward.
Trade with trend by distinguishing bull vs bear markets.
With continuous improvements, the strategy can become a steady short term trading system.
Conclusion
This strategy combines the 123 pattern and CCI indicator to identify high probability price reversal opportunities using dual confirmation. It offers quality signals, flexibility of use and ease of adoption. But parameters and asset selection need optimization along with trade frequency and loss control. With ongoing refinements, it can evolve into an efficient short term reversal trading strategy.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 14 | Length |
| v_input_2 | true | KSmoothing |
| v_input_3 | 3 | DLength |
| v_input_4 | 50 | Level |
| v_input_5 | 10 | FastMA |
| v_input_6 | 20 | SlowMA |
| v_input_7 | false | Trade reverse |
Source Pine Script
/*backtest
start: 2023-08-25 00:00:00
end: 2023-09-24 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 11/07/2019
// This is combo strategies for get a cumulative signal.
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
// The strategy sells at market, if close price is lower than the previous close price
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// The Commodity Channel Index (CCI) is best used with markets that display cyclical or
// seasonal characteristics, and is formulated to detect the beginning and ending of these
// cycles by incorporating a moving average together with a divisor that reflects both possible
// and actual trading ranges. The final index measures the deviation from normal, which indicates
// major changes in market trend.
// To put it simply, the Commodity Channel Index (CCI) value shows how the instrument is trading
// relative to its mean (average) price. When the CCI value is high, it means that the prices are
// high compared to the average price; when the CCI value is down, it means that the prices are low
// compared to the average price. The CCI value usually does not fall outside the -300 to 300 range
// and, in fact, is usually in the -100 to 100 range.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
vFast = sma(stoch(close, high, low, Length), KSmoothing)
vSlow = sma(vFast, DLength)
pos = 0.0
pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0)))
pos
CCI(FastMA, SlowMA) =>
pos = 0
xCCI = cci(close, 10)
xSMA = sma(xCCI,SlowMA)
xFMA = sma(xCCI,FastMA)
pos := iff(xSMA < xFMA , 1,
iff(xSMA > xFMA, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Strategy 123 Reversal & CCI", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
FastMA = input(10, minval=1)
SlowMA = input(20, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCCI = CCI(FastMA, SlowMA)
pos = iff(posReversal123 == 1 and posCCI == 1 , 1,
iff(posReversal123 == -1 and posCCI == -1, -1, 0))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1, 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
if (possig == 0)
strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-25. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Dual-Indicator-Reversal-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Multi Indicator Scoring Trading StrategyPine Script · Mean reversion · 1d
- Rainbow OscillatorPine Script · Mean reversion · 1h
- A Momentum Tracking Mean Reversion StrategyPine Script · Mean reversion · 1h
- Dynamic RSI and CCI Combined Multi factor Quantitative Trading StrategyPine Script · Mean reversion · 1m
- Quantitative Trading Reversal Trend Combo T3 CCI StrategyPine Script · Mean reversion · 1h
- Adaptive Trading Strategy Combining Dynamic Trend Reversal and Stochastic IndicatorPine Script · Mean reversion · 1d