逆転トレンドブレイク戦略は,逆転戦略と突破戦略の優位性を組み合わせた戦略で,トレンドブレイクポイントで取引シグナルを発信することを目的としている.この戦略は,価格が2日連続で反転形状を呈しているかどうかを判断し,指数であるストキャスティック・オシレータが反転シグナルを発信しているかどうかを判断し,合っている場合は買入または販売シグナルを発信する.同時に,この戦略は,価格が指定された周期内の最高値または最低値を破ったかどうかを判断し,反転と突破の条件を同時に満たせば取引シグナルを発信する.
この戦略は2つの部分から構成されています.
価格が2日連続で反転した判断 ((2日目閉盘価格が1日目より高く,ストキャスティック快線が慢線より低い時に買い;2日目閉盘価格が1日目より低く,快線が慢線より高い時に売り))
価格が look_bak 周期内の最高値を破ったかどうかを判断する (最高値を破れば購入する).
逆転部分と突破部分の信号が同方向であるとき (例えば,逆転が買入信号を表示し,突破も買入信号を表示する) は,実際の買入または売出信号を生成する.
このコンビネーション戦略は,反転とトレンドを突破する2つの取引戦略の優位性を組み合わせ,トレンドの転換点でより正確にシグナルをキャプチャすることができます.
逆転部分は,価格の逆転時に信号を発し,ターニングポイントを捕捉するのに適しています.
突破部分では,トレードシグナルの方向がトレンドと一致することを確認し,取引の誤った方向を回避します.
この2つの部分が同方向に信号を発信すると,より信頼性の高い取引機会が生まれる.
ストキャスティック指標の適用は,価格の形状のみによる判断の主観性を回避する.
この戦略にはいくつかのリスクがあります.
逆転信号は偽の突破であり,逆転傾向が確立されていることを確認できない。 may optimize it by:
突破の信号は錯覚の突破であり,トレンドが始まっているとは判断できない.
この2つの指標のパラメータを正しく設定しない場合,取引機会が失われる可能性があります.
取引頻度が高くなり,取引回数を制御するためにパラメータを適切に調整できます.
対応する最適化策
逆転指標のパラメータを最適化して,逆転信号をより信頼できるようにする.
突破パラメータを最適化し,誤った突破を回避する.
逆転と突破部分のパラメータ設定を調整し,最適のマッチを見つけます.
取引の頻度を適切に調整して,過剰な取引を防止する.
逆転トレンドブレイク戦略は,反転とトレンドブレイク戦略の総合的な使用の優位性を利用し,価格の転換点で信頼性の高い取引信号を発信する.パラメータを最適化することで,取引頻度を制御しながら,信号の質を向上させ,信頼性の高い取引機会を捕捉することができる.この戦略は全体的に安定しているが,偽ブレイクや錯覚ブレイクがもたらすリスクを防ぐことに注意する必要がある.
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.
The strategy consists of two parts:
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).
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.
This combo strategy combines the pros of reversal and trend breakout strategies and can more accurately capture signals at trend turning points:
The reversal part can generate signals when prices reverse, suitable to catch turning points.
The breakout part ensures trade direction is aligned with the trend, avoiding trading in wrong direction.
Signals in the same direction from both parts create more reliable trading opportunities.
The application of Stochastic avoids the subjectivity of judging by price pattern alone.
There are also some risks to note:
Reversal signals may be false breakouts, unable to confirm the reversal trend has established.
Breakout signals may be false breakouts, unable to judge the trend has started.
Improper parameter settings of the two parts may lead to missing trades.
High trading frequency may occur and needs to be controlled.
Possible optimizations:
Optimize parameters of reversal indicators to ensure reversal signals are more reliable.
Optimize breakout parameters to avoid false breakouts.
Adjust parameters of both parts to find the optimal match.
Moderate the trading frequency to prevent over-trading.
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 )