역전향 돌파 전략은 역전향 전략과 돌파 전략의 장점을 결합하여 트렌드 돌파점에 거래 신호를 발산하기 위한 조합 전략이다. 이 전략은 우선 가격이 2일 연속으로 역전형태를 나타내고 있는지 판단하고, 동시 Stochastic Oscillator가 반전 신호를 발산하는지 판단하며, 이를 충족하면 구매 또는 판매 신호를 발산한다. 동시에, 이 전략은 가격이 지정된 기간 내의 최고 또는 최저 가격을 돌파했는지 판단하고, 반전 및 돌파 조건을 동시에 충족하면 거래 신호를 발산한다.
이 전략은 두 부분으로 구성되어 있습니다.
가격의 2 일 연속 반전이 발생한다고 판단하십시오 ((2 일 종결 가격이 1 일보다 높고, Stochastic 빠른 선이 느린 선보다 낮았을 때 구매하십시오; 2 일 종결 가격이 1 일보다 낮고, 빠른 선이 느린 선보다 높을 때 판매하십시오))
가격이 look_bak 주기 내 최고 가격을 뚫었는지 판단하기 (최고 가격을 뚫으면 구매한다)
반전 부분과 돌파 부분 신호가 동방향일 때 (예를 들어, 반전 부분에서 구매 신호를 표시하고, 돌파 부분에서도 구매 신호를 표시) 실제 구매 또는 판매 신호가 생성된다.
이 조합 전략은 역전과 트렌드 돌파의 두 가지 거래 전략의 장점을 결합하여 트렌드 전환점에서 더 정확하게 신호를 잡을 수 있습니다.
반전 부분은 가격이 반전될 때 신호를 발산할 수 있으며, 전환점을 잡는 데 적합하다.
돌파구 부분은 트레이딩 신호의 방향이 트렌드와 일치하도록 하고, 트레이딩의 잘못된 방향을 방지한다.
두 부분에서 동방향으로 신호를 발산하면 더 신뢰할 수 있는 거래 기회가 발생한다.
스토카스틱 지표의 적용은 가격 형태에만 근거한 판단의 주관성을 피한다.
이 전략에는 몇 가지 위험도 있습니다.
역전 신호는 가짜 돌파구일 수 있으며, 역전 추세가 확립되었다는 것을 확인할 수 없다. may optimize it by:
트렌드가 이미 시작되었는지 판단할 수 없는 돌파 신호가 있을 수 있습니다.
두 부분의 지표 파라미터를 잘못 설정하면 놓친 거래 기회가 발생할 수 있습니다.
거래 빈도가 너무 높을 수 있으며, 거래 횟수를 제어하기 위해 파라미터를 적절히 조정할 수 있다.
대응 최적화 조치:
역전 지표 매개 변수를 최적화하여 역전 신호를 보다 안정적으로 보장한다.
돌파변수를 최적화하여 착각 돌파를 피한다.
역전과 돌파 부분의 파라미터 설정을 조정하여 최적의 매칭을 찾습니다.
거래 빈도를 적절하게 조정하여 너무 자주 거래되는 것을 방지하십시오.
반전 트렌드 돌파 전략은 반전 및 트렌드 돌파 전략의 장점을 통합하여 가격 전환점에서 거래 신호를 안정적으로 발송한다. 매개 변수를 최적화하여 거래 주파수를 제어하면서 신호 품질을 높이고 신뢰할 수 있는 거래 기회를 잡을 수 있다. 이 전략은 전반적으로 안정적이지만 가짜 돌파 및 착각 돌파의 위험을 방지하는 데 주의가 필요합니다.
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 )