
이중 반전량 전략은 가격 반전 신호와 변동률 반전 신호를 결합하여 트렌드 거래를 실현한다. 그것은 주로 123 형태 판단 가격 반전 지점을 기반으로 하며, 동시에 Donchian 채널 변동률을 사용하여 거짓 신호를 필터링하는 보조적이다. 이 전략은 중장선 지점을 보유하는 데 적합하며, 이중 반전 필터를 통해 시장 전환점을 효과적으로 포착하여 초과 수익을 얻을 수 있다.
가격 반전의 부분은 123 형태 판단을 사용합니다. 이 형태는 첫 번째 두 K 선의 가격이 반전 (상승 또는 하락) 을 나타내고, 세 번째 K 선이 다시 반전 (상승 또는 하락) 을 나타냅니다. 따라서 123 형태라고합니다. 가격이 세 개의 K 선 반전 현상을 나타낼 때, 일반적으로 단기 트렌드가 전환 될 것을 나타냅니다. 가격 반전의 신뢰성을 추가로 검증하기 위해, 이 전략은 무작위 지표 판단을 사용합니다.
변동률 반향 부분에는 Donchian channel 변동률이 사용된다. Donchian channel은 주로 가격의 변동 범위를 반영한다. 가격 변동이 커지면 Donchian channel 폭도 넓어지고, 가격 변동이 작아지면 Donchian channel 폭도 좁아진다. Donchian channel 변동률 폭도 () 는 시장의 변동 정도와 위험 수준을 효과적으로 측정한다. 이 전략은 Donchian channel 변동률의 반향을 사용하여 가짜 신호를 차단한다.
종합적으로, 이 전략은 트레이딩 신호의 신뢰성을 보장하고 위험을 통제하는 두 번의 역으로 검증되며, 비교적 튼튼한 트렌드 전략이다.
이중 역동량 전략은 가격 역전과 변동률 역전의 이중 검증을 통해 더 나은 위험 통제를 달성한다. 단일 지표에 비해, 그것은 많은 양의 소음을 필터링하고 안정성이 더 좋다. 이 전략은 파라미터 최적화, 손해 모듈 강화, 양력 도입과 같은 수단을 통해 신호 품질과 수익 안정성을 더욱 향상시킬 수 있다. 주식, 디지털 통화 등의 중장기 전략의 구성 요소로 적합하며, 다른 모듈과 합리적으로 조합하여 좋은 초과 수익을 얻을 수 있다.
/*backtest
start: 2024-01-20 00:00:00
end: 2024-02-19 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 06/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
// The Donchian Channel was developed by Richard Donchian and it could be compared
// to the Bollinger Bands. When it comes to volatility analysis, the Donchian Channel
// Width was created in the same way as the Bollinger Bandwidth technical indicator was.
//
// As was mentioned above the Donchian Channel Width is used in technical analysis to measure
// volatility. Volatility is one of the most important parameters in technical analysis.
// A price trend is not just about a price change. It is also about volume traded during this
// price change and volatility of a this price change. When a technical analyst focuses his/her
// attention solely on price analysis by ignoring volume and volatility, he/she only sees a part
// of a complete picture only. This could lead to a situation when a trader may miss something and
// lose money. Lets take a look at a simple example how volatility may help a trader:
//
// Most of the price based technical indicators are lagging indicators.
// When price moves on low volatility, it takes time for a price trend to change its direction and
// it could be ok to have some lag in an indicator.
// When price moves on high volatility, a price trend changes its direction faster and stronger.
// An indicator's lag acceptable under low volatility could be financially suicidal now - Buy/Sell signals could be generated when it is already too late.
//
// Another use of volatility - very popular one - it is to adapt a stop loss strategy to it:
// Smaller stop-loss recommended in low volatility periods. If it is not done, a stop-loss could
// be generated when it is too late.
// Bigger stop-loss recommended in high volatility periods. If it is not done, a stop-loss could
// be triggered too often and you may miss good trades.
//
// 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
DCW(length, smoothe) =>
pos = 0.0
xUpper = highest(high, length)
xLower = lowest(low, length)
xDonchianWidth = xUpper - xLower
xSmoothed = sma(xDonchianWidth, smoothe)
pos := iff(xDonchianWidth > xSmoothed, -1,
iff(xDonchianWidth < xSmoothed, 1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Donchian Channel Width", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthDCW = input(20, minval=1)
SmootheSCW = input(22, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posDCW = DCW(LengthDCW, SmootheSCW)
pos = iff(posReversal123 == 1 and posDCW == 1 , 1,
iff(posReversal123 == -1 and posDCW == -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 )