Dual Reversal Tracking Strategy

Author: ChaoZhang, Date: 2023-11-22 17:42:23
Tags:

img

Overview

The Dual Reversal Tracking strategy combines the 123 Reversal and Key Reversal Down sub-strategies to achieve more precise trading signal capture. The 123 Reversal strategy observes the comparison of the closing price with the previous two days and judges potential reversals combined with the Stoch indicator. The Key Reversal Down strategy judges reversal signals by observing new lows in a downtrend. The combination of signals from the two strategies can make trading decisions more accurate and reliable.

Principle

This strategy consists of two sub-strategies. The first sub-strategy, the 123 Reversal strategy, has the following logic:

  1. If today’s and yesterday’s closing prices are both higher than the day before yesterday, and the fast Stoch indicator is below the slow Stoch indicator and the fast line is below 50, go long.

  2. If today’s and yesterday’s closing prices are both lower than the day before yesterday, and the fast Stoch indicator is above the slow Stoch indicator and the fast line is above 50, go short.

The second sub-strategy, the Key Reversal Down strategy, has a very simple judgment logic:

In a downtrend, if a new low appears, go short.

The actual trading signal of the entire strategy is that only when the signals of the two sub-strategies are in the same direction, the actual trading signal is issued.

Advantage Analysis

The biggest advantage of this strategy is the accuracy and reliability of signals. Because it requires the signals of the two sub-strategies to be in the same direction before actually placing orders, some noisy trades can be filtered out, which greatly improves the stability of the strategy.

In addition, the strategy combines multi-timeframe information including dual-day line comparison and multi-day Stoch indicator information, making the judgment basis more comprehensive and reliable.

In principle, this strategy satisfies the characteristics of both reversal and trend-following strategies, making it suitable for actual application in reality.

Risk Analysis

The biggest risk of this strategy is that the requirement for dual signals also increases the probability of missing opportunities. Trading opportunities will be missed when the signals of the two sub-strategies are inconsistent.

In addition, the sub-strategies themselves also have some problems. The 123 Reversal strategy is highly sensitive to parameters and needs careful testing and optimization. The Key Reversal Down strategy does not work well for ranging markets.

These issues can be solved by adjusting parameters and introducing other auxiliary judgments.

Optimization Directions

This strategy can be optimized in the following aspects:

  1. Adjust the parameters of the sub-strategies to better match the characteristics of specific products.

  2. Introduce auxiliary indicators such as Volume and volatility to improve decision accuracy.

  3. Increase machine learning model judgment to automatically optimize parameters using historical data.

Summary

The Dual Reversal Tracking strategy achieves dual insurance of reversal capturing through the combination 123 Reversal and Key Reversal Down sub-strategies. It combines the advantages of reversal and trend-following strategies, with broad application prospects in reality. Through parameter and model optimization, the effect of this strategy can be further improved to become an important tool for reversal traders.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-06-14 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 21/12/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
// A key reversal is a one-day trading pattern that may signal the reversal of a trend. 
// Other frequently-used names for key reversal include "one-day reversal" and "reversal day."
// How Does a Key Reversal Work?
// Depending on which way the stock is trending, a key reversal day occurs when:
// In an uptrend -- prices hit a new high and then close near the previous day's lows.
// In a downtrend -- prices hit a new low, but close near the previous day's highs
//
// 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

KRD(nLength) =>
    pos = 0.0
    xHH = highest(high[1], nLength)
    C1 = iff(high > xHH and close < close[1], true, false)
    pos := iff(C1, -1, 0)
    pos

strategy(title="Combo Backtest 123 Reversal & Key Reversal Down", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
nLength = input(1, minval=1, title="Enter the number of bars over which to look for a new high in prices.")
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posKRD = KRD(nLength)
pos = iff(posReversal123 == 1 and posKRD == 1 , 1,
	   iff(posReversal123 == -1 and posKRD == -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 )

More