이중 확인과 함께 역동 동력 전략

저자:차오장, 날짜: 2024-02-20 15:27:02
태그:

img

전반적인 설명

리버설 모멘텀 전략은 트렌드 트레이딩을 구현하기 위해 가격 역전 신호와 변동성 역전 신호를 결합합니다. 주로 123 패턴을 사용하여 가격 역전 지점을 결정하며, 돈치안 채널 변동성을 잘못된 신호를 위한 필터로 사용합니다. 이 전략은 중장기 보유에 적합합니다. 역전의 두 번 확인을 통해 시장 전환점을 효과적으로 파악하고 과도한 수익을 얻을 수 있습니다.

전략 원칙

가격 역전 부분은 123 패턴을 사용하여 판단합니다. 이 패턴은 첫 두 K 라인의 가격이 반대 방향으로 (올림 또는 하락) 움직이고 세 번째 K 라인이 다시 (하락 또는 상승) 역전된다는 것을 의미합니다. 따라서 123 패턴이라고 불립니다. 가격이 세 K 라인이 역전되어 나타나면 일반적으로 단기 트렌드가 돌릴 것이라는 신호입니다. 가격 역전의 신뢰성을 더 확인하기 위해이 전략은 또한 스토카스틱 인디케이터도 역전되면 (빠른 라인 하락 또는 급격히 상승) 트레이드를 촉발하기 위해 스토카스틱 인디케이터를 사용합니다.

변동성 역전 부분은 돈치안 채널 변동성을 사용합니다. 돈치안 채널은 주로 가격 변동 범위를 반영합니다. 가격 변동성이 증가하면 돈치안 채널의 폭도 확장됩니다. 가격 변동성이 감소하면 돈치안 채널의 폭도 좁아집니다. 돈치안 채널 변동성 (폭) 은 시장 변동과 위험 수준을 효과적으로 측정 할 수 있습니다. 이 전략은 잘못된 신호를 필터링하기 위해 돈치안 채널 변동성의 역전을 사용하여 변동성과 가격이 동시에 역전될 때만 거래 신호를 발행하여 콜백 운영에 걸리지 않도록합니다.

요약하자면 이 전략은 거래 신호의 신뢰성을 보장하고 이중 역전 검증을 통해 위험을 통제하여 비교적 견고한 트렌드 전략입니다.

장점

  • 이중 필터링 메커니즘은 거래 신호의 신뢰성을 보장하고 가짜 브레이크를 방지합니다.
  • 리스크를 통제하고 손실의 가능성을 줄입니다.
  • 중장기 보유에 적합하며 시장 소음을 피하고 과잉 수익을 포착합니다.
  • 최적 상태를 위해 조정할 수 있는 매개 변수에 대한 큰 최적화 공간
  • 독특한 스타일은 일반적인 기술 지표와 결합되어 잘 작동합니다.

위험성

  • 매개 변수 최적화에 의존하고, 부적절한 매개 변수는 전략 성과에 영향을 미칩니다.
  • 스톱 로스 전략은 더 강화되어야 하며 최대 마감 통제는 개선되어야 합니다.
  • 거래 빈도는 낮을 수 있으며, 높은 빈도의 알고리즘 거래에 적응할 수 없습니다.
  • 적절한 제품 선택과 시간 프레임, 제한된 적용 범위를 요구합니다
  • 기계 학습은 최적의 매개 변수를 찾기 위해 사용될 수 있습니다.

최적화 방향

  • 최대 마감량을 크게 줄이기 위해 적응 스톱 손실 모듈을 증가
  • 거래량 지표를 도입하여 높은 거래량 브레이크에 진입하는 것을 보장합니다
  • 최고의 안정성을 위해 매개 변수를 최적화
  • 가장 적합한 제품을 찾기 위해 다른 제품과 시간 프레임을 시도하십시오.
  • 1+1>2 시너지를 위해 다른 지표 또는 전략과 결합하려고 노력하십시오.

요약

리버설 모멘텀 전략은 가격 역전 및 변동성 역전의 이중 확인을 통해 좋은 위험 통제를 달성합니다. 단일 지표와 비교하면 많은 소음을 필터링하고 더 나은 안정성을 가지고 있습니다. 매개 변수 최적화, 스톱 로스 모듈, 볼륨 도입 등을 강화함으로써이 전략은 신호 품질과 수익 안정성을 더욱 향상시킬 수 있습니다. 주식, 암호화폐 등에 대한 중장기 전략의 구성 요소로 적합하며 다른 모듈과 적절하게 결합하면 좋은 초과 수익을 얻을 수 있습니다.


/*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 )

더 많은