The resource loading... loading...

Reversal Breakout Trend Strategy

Author: ChaoZhang, Date: 2023-10-07 16:15:43
Tags:

See also:

A reversal trend breakout strategy is a combination strategy that combines the advantages of a reversal strategy and a breakout strategy to signal a trade at a trend reversal point. The strategy first determines whether the price will reverse for two consecutive days, and the Stochastic Oscillator will signal a reversal, which will produce a buy or sell signal if it meets.

The Principles of Strategy

The strategy consists of two parts:

  1. Reversed section

Judging the price reversal for two consecutive days (day 2 closes higher than day 1, Stochastic fast lines buy lower than slow lines; day 2 closes lower than day 1, fast lines sell higher than slow lines)

  1. Breakthrough section

Determine if the price breaks the highest price in the look_bak cycle (if it breaks the highest price, buy).

When the reversal part and the breakout part of the signal are in the same direction (e.g. the reversal shows a buy signal, the breakout also shows a buy signal), an actual buy or sell signal is generated.

Strategic advantages

This combined strategy combines the advantages of both reversal and trend breakout trading strategies to capture signals more accurately at trend turning points.

  1. The reversal section can send a signal when the price reverses, which is suitable for capturing the turning point.

  2. The breakout part ensures that the direction of the trading signal is consistent with the trend and avoids trading in the wrong direction.

  3. When both parts of the signal are sent in the same direction, more reliable trading opportunities can be created.

  4. The use of stochastic indicators avoids subjectivity based solely on price formulas.

Risk and Optimization

There are also some risks to this strategy:

  1. The reversal signal may be a false breakthrough, and it is not possible to determine if the reversal trend has been established.

  2. The breakout signal may be the illusion of a breakthrough, and it is impossible to tell if the trend has already begun.

  3. Improper setting of the parameters of both indicators can lead to missed trading opportunities.

  4. The frequency of transactions may be too high and parameters can be adjusted accordingly to control the number of transactions.

How to optimize:

  1. Optimized reversal indicator parameters to ensure reversal signal is more reliable.

  2. Optimize the breakthrough parameters to avoid the illusion of breakthrough.

  3. Adjust the parameter settings of the reverse and break-through sections to find the best match.

  4. The frequency of transactions should be adjusted accordingly to prevent excessive frequency of transactions.

Summary

The reversal trend breakout strategy combines the advantages of reversal and trend breakout strategies to reliably send trading signals at price turning points. By optimizing parameters, the signal quality can be improved while controlling the frequency of trading. The strategy is generally more robust, but it requires attention to prevent the risk of false breakouts and false breakouts.

Overview

The Reversal Breakout Trend strategy is a combo strategy that combines the advantages of reversal and breakout strategies to generate trading signals at trend reversal points. It first judges if prices reverse during two consecutive days and if the Stochastic Oscillator gives reversal signals. At the same time, it also checks if prices break through the highest/lowest prices over a certain period. When reversal and breakout conditions are met, trading signals are generated.

Strategy Logic

The strategy consists of two parts:

  1. Reversal Part

It judges if prices reverse during two consecutive days (buy when close of day 2 is higher than day 1 and Stochastic fast line is lower than slow line; sell when close of day 2 is lower than day 1 and fast line is higher than slow line).

  1. Breakout Part

It judges if prices break through the highest price over the look_bak period (buy if price breaks through the highest price).

When reversal and breakout parts give signals in the same direction (e.g. reversal shows buy and breakout shows buy), actual buy/sell signals are generated.

Advantages

This combo strategy combines the pros of reversal and trend breakout strategies and can more accurately capture signals at trend turning points:

  1. The reversal part can generate signals when prices reverse, suitable to catch turning points.

  2. The breakout part ensures trade direction is aligned with the trend, avoiding trading in wrong direction.

  3. Signals in the same direction from both parts create more reliable trading opportunities.

  4. The application of Stochastic avoids the subjectivity of judging by price pattern alone.

Risks and Optimization

There are also some risks to note:

  1. Reversal signals may be false breakouts, unable to confirm the reversal trend has established.

  2. Breakout signals may be false breakouts, unable to judge the trend has started.

  3. Improper parameter settings of the two parts may lead to missing trades.

  4. High trading frequency may occur and needs to be controlled.

Possible optimizations:

  1. Optimize parameters of reversal indicators to ensure reversal signals are more reliable.

  2. Optimize breakout parameters to avoid false breakouts.

  3. Adjust parameters of both parts to find the optimal match.

  4. Moderate the trading frequency to prevent over-trading.

Summary

The Reversal Breakout Trend strategy leverages the strengths of reversal and trend breakout strategies and reliably generates trading signals at turning points. Through parameter optimization, it can improve signal quality and capture solid trading opportunities while controlling trading frequency. Overall this strategy is robust but false breakouts remain a risk to watch out for. Proper optimization and parameter tuning is key.

[/trans]


/*backtest
start: 2023-09-29 00:00:00
end: 2023-10-06 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 26/06/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
//    Breakout Range Long Strategy
//
// 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

BreakoutRangeLong(look_bak) =>
    pos = 0
    xHighest = highest(high, look_bak)
    pos := iff(high > xHighest[1], 1, 0) 
    pos

strategy(title="Combo Backtest 123 Reversal & Breakout Range Long", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
look_bak = input(4, minval=1, title="Look Bak")
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posBreakoutRangeLong = BreakoutRangeLong(look_bak)
pos = iff(posReversal123 == 1 and posBreakoutRangeLong == 1 , 1,
	   iff(posReversal123 == -1 and posBreakoutRangeLong == -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 ? red: possig == 1 ? green : blue )

More