Strategy vault / Mean reversion
Quantitative Trading Reversal Trend Combo T3 CCI Strategy
This strategy combines the use of reversal trend strategy and T3-CCI indicator to generate trading signals at market reversal points. It belongs to short-term quantitative trading strategies.

Overview
This strategy combines the use of reversal trend strategy and T3-CCI indicator to generate trading signals at market reversal points. It belongs to short-term quantitative trading strategies.
Strategy Principle
Reversal Trend Strategy Part: Use 2-day close price comparison to judge price reversal signals, combined with 9-day slow K-line indicator to determine overbought and oversold areas, and generate long and short signals.
T3-CCI Part: Use T3 moving average to resmooth the CCI indicator to reduce false signals and determine overbought and oversold areas. It is used together with the reversal trend strategy to filter entry timing.
The final trading direction is determined by the integrated signals from both parts.
Advantage Analysis
Using two types of indicators and price comparisons can effectively identify potential reversal points.
The application of T3 moving average improves the quality of CCI signals and reduces false signals.
The combined use of different types of strategies can be expected to improve the overall stability of the strategy.
Risk Analysis
In case of reversal failure, it will generate wrong signals and losses. Timely stop loss is required to control risks.
Improper parameter settings will also affect strategy performance. Parameters need to be adjusted according to different markets.
Reversal signals have poor timeliness and cannot capture rapid reversals in time.
Optimization Directions
Increase trend filtering to avoid losses caused by reversal failures.
Try machine learning methods to automatically optimize parameters.
Increase stop loss mechanism.
Explore more efficient indicators to judge reversal timing.
Summary
This strategy combines multiple technical indicators to judge potential reversal points. It can effectively tap market reversal opportunities and is suitable for short-term operations. Through measures such as parameter adjustment, stop loss protection, combination with trend judgment and other optimization methods, the stability of the strategy can be further enhanced.
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 | 14 | CCI_Period |
| v_input_6 | 5 | T3_Period |
| v_input_7 | 0.618 | b |
| v_input_8 | false | Trade reverse |
Source Pine Script
/*backtest
start: 2023-11-28 00:00:00
end: 2023-12-21 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 23/10/2020
// 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
// This simple indicator gives you a lot of useful information - when to enter, when to exit
// and how to reduce risks by entering a trade on a double confirmed signal.
// You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
//
// 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
T3_CCI(CCI_Period,T3_Period,b) =>
pos = 0.0
e1 = 0.0
e2 = 0.0
e3 = 0.0
e4 = 0.0
e5 = 0.0
e6 = 0.0
xPrice = close
b2 = b*b
b3 = b2*b
c1 = -b3
c2 = (3*(b2 + b3))
c3 = -3*(2*b2 + b + b3)
c4 = (1 + 3*b + b3 + 3*b2)
nn = iff(T3_Period < 1, 1, T3_Period)
nr = 1 + 0.5*(nn - 1)
w1 = 2 / (nr + 1)
w2 = 1 - w1
xcci = cci(xPrice, CCI_Period)
e1 := w1*xcci + w2*nz(e1[1])
e2 := w1*e1 + w2*nz(e2[1])
e3 := w1*e2 + w2*nz(e3[1])
e4 := w1*e3 + w2*nz(e4[1])
e5 := w1*e4 + w2*nz(e5[1])
e6 := w1*e5 + w2*nz(e6[1])
xccir = c1*e6 + c2*e5 + c3*e4 + c4*e3
pos:= iff(xccir > 0, 1,
iff(xccir < 0, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & FX Sniper: T3-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)
//-------------------------
CCI_Period = input(14, minval=1)
T3_Period = input(5, minval=1)
b = input(0.618)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posT3_CCI = T3_CCI(CCI_Period,T3_Period,b)
pos = iff(posReversal123 == 1 and posT3_CCI == 1 , 1,
iff(posReversal123 == -1 and posT3_CCI == -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-12-29. 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/Quantitative-Trading-Reversal-Trend-Combo-T3-CCI-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
- Dual Indicator Reversal Trading StrategyPine Script · Mean reversion · 3h
- 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
- Adaptive Trading Strategy Combining Dynamic Trend Reversal and Stochastic IndicatorPine Script · Mean reversion · 1d