Strategy vault / Mean reversion
Dual Reversal Overlap Selective Strategy
The Dual Reversal Overlap Selective Strategy combines reversal trading strategies with overbought-oversold filters to achieve asset allocation and timing trading. It aims to take long and short positions at trend…

Overview
The Dual Reversal Overlap Selective Strategy combines reversal trading strategies with overbought-oversold filters to achieve asset allocation and timing trading. It aims to take long and short positions at trend reversal points while avoiding unnecessary trades in irrational extended zones using overbought-oversold indicators.
Strategy Logic
The strategy consists of two overlapping sub-strategies:
- 123 Reversal Strategy
This strategy uses reversal signals based on two consecutive days of closing price reversal. Specifically, it goes long if closing prices rise over the last two days and the 9-day slow stochastic is below 50, and goes short if closing prices fall over the last two days and the 9-day fast stochastic is above 50. This reversal strategy aims to capture short-term trend reversals.
- DSS Oscillator Strategy
This strategy uses the DSS oscillator for overbought-oversold analysis. It goes long if the 5-day MA is below the 10-day MA and the 20 oversold level, and goes short if the 5-day MA is above the 10-day MA and the 80 overbought level. This overbought-oversold strategy helps avoid unnecessary trades in irrational zones.
The final signal is generated only when both strategies agree. This improves profitability by combining the strengths of the two strategy types.
Advantage Analysis
Combines the advantages of reversal and overbought-oversold strategies - catching short-term reversals while avoiding irrational zone trades.
Simple logic and few parameters make 123 reversal easy to implement. DSS uses double smoothing for robust overbought-oversold analysis.
Combination improves signal reliability by reducing false signals.
Flexible parameter tuning adapts the strategy to different markets.
Risk Analysis
Reversal strategies have "picking up pennies" risk and whipsaw in ranging markets.
DSS optimization is difficult and sensitive to parameters.
Divergent signals may miss trading opportunities.
Simple price indicators limit profitability.
Solutions:
Shorten holding periods to reduce whipsaw risk.
Careful parameter tuning based on successful examples.
Add filters to improve strategy.
Optimize entry timing or position sizing.
Enhancement Directions
Test other reversal indicators to improve signal accuracy.
Explore alternative overbought-oversold indicators like RSI.
Add stop loss to lock in profits and limit losses.
Optimize parameters for different markets.
Consider dynamic parameter adjustment.
Build machine learning models to generate signals.
Conclusion
The Dual Reversal Overlap Selective Strategy provides both asset allocation and timing trading functionality through combining reversal and overbought-oversold strategies. It has advantages like flexible parameters, simple logic, and easy implementation, effectively filtering out noise trades in irrational zones. But limitations exist like reversal risks and parameter optimization difficulties. Future enhancements can come from adding stop loss, parameter optimization, machine learning incorporation etc. Overall, it provides a robust quantitative trading solution.
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 | PDS |
| v_input_6 | 9 | EMAlen |
| v_input_7 | 5 | TriggerLen |
| v_input_8 | 80 | Overbought |
| v_input_9 | 20 | Oversold |
| v_input_10 | false | Trade reverse |
Source Pine Script
/*backtest
start: 2023-09-25 00:00:00
end: 2023-10-25 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 12/03/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
// Double Smoothed Stochastics (DSS) is designed by William Blaw.
// It attempts to combine moving average methods with oscillator principles.
//
// 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
DSSB(PDS, EMAlen,TriggerLen,Overbought,Oversold) =>
pos = 0
xPreCalc = ema(stoch(close, high, low, PDS), EMAlen)
xDSS = ema(stoch(xPreCalc, xPreCalc, xPreCalc, PDS), EMAlen)
xTrigger = ema(xDSS, TriggerLen)
pos := iff(xTrigger < xDSS and xTrigger < Oversold, -1,
iff(xTrigger > xDSS and xTrigger > Overbought, 1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & DSS Bressert", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
PDS = input(10, minval=1)
EMAlen = input(9, minval=1)
TriggerLen = input(5, minval=1)
Overbought = input(80, minval=1)
Oversold = input(20, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posDSS = DSSB(PDS, EMAlen,TriggerLen,Overbought,Oversold)
pos = iff(posReversal123 == 1 and posDSS == 1 , 1,
iff(posReversal123 == -1 and posDSS == -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-10-26. 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-Reversal-Overlap-Selective-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
- Advanced 15 Minute Chart Trading Signal StrategyPine Script · Mean reversion · 3h
- Dynamic Adaptive Multi Timeframe Trend Following and Range Reversal Hybrid StrategyPine Script · Mean reversion · 2d
- Oma and Apollo Dual Rail Trading StrategyPine Script · Mean reversion · 5m
- 3EMA with Stochastic RSI StrategyPine Script · Mean reversion · 1h
- Market Cypher Wave B Automated Trading StrategyPine Script · Mean reversion · 1h
- Multi Indicator Trend Reversal Trading StrategyPine Script · Mean reversion · 1h