돈치안 채널 너비 거래 전략

저자:차오장, 날짜: 2024-02-04 10:35:11
태그:

img

전반적인 설명

돈치안 채널 너비 거래 전략은 돈치안 채널 지표에 기초하여 개발된 양적 거래 전략이다. 이 전략은 시장 변동과 위험 수준을 판단하기 위해 특정 기간 동안 가장 높은 가격과 가장 낮은 가격의 차이를 계산합니다. 돈치안 채널 너비가 매끄러운 이동 평균보다 크면 시장 변동성이 증가하고 높은 위험 상태에 있음을 나타냅니다. 더 작을 때 시장 변동성이 감소하고 낮은 위험 상태에 있음을 나타냅니다. 그러한 판단을 통해 시장 추세와 운영 방향을 명확히 정의 할 수 있습니다.

전략 원칙

이 전략의 핵심 지표는 돈치안 채널의 너비입니다. 돈치안 채널의 너비 계산 공식은 다음과 같습니다.

돈치안 채널 너비 = 가장 높은 가격 - 가장 낮은 가격

가장 높은 가격과 가장 낮은 가격이 특정 기간 동안 계산되는 경우 n. 이 기간은 길이 매개 변수를 통해 설정됩니다.

돈치안 채널 너비 데이터를 부드럽게하기 위해 전략은 또한 부드러운 이동 평균 (SMA) 표시기를 도입합니다. 이 지표는 오류를 줄이기 위해 돈치안 채널 너비에 대한 2차 계산을 수행합니다.

시장 위험 수준을 판단할 때, 돈치안 채널의 폭이 매끄러운 이동 평균보다 크다면 시장이 높은 변동성과 높은 위험 상태에 들어간다는 것을 의미합니다.

위험 수준 판단에 따라 전략은 적절한 거래 결정을 내릴 것입니다. 높은 위험에서 짧고 낮은 위험에서 길게 이동합니다.

이점 분석

이 전략의 가장 큰 장점은 변동성을 통해 시장 위험을 판단하여 대응하는 거래 결정을 내리는 것입니다. 이것은 고위험 시장에서 장기간에 걸리는 것을 계속하거나 낮은 위험 시장에서 여전히 짧게가는 것을 효과적으로 방지하여 불필요한 손실을 줄일 수 있습니다.

또한, 이 전략은 돈치안 채널의 너비와 그 부드러운 이동 평균을 결합하여 신호 판단을 더 신뢰할 수 있도록 하고 데이터 변동으로 인한 오류 거래를 피합니다.

일반적으로 이 전략은 시장 위험을 어느 정도 판단하고 상대적으로 안정적인 거래 결정을 내릴 수 있습니다. 이것이 가장 큰 장점입니다.

위험 분석

이 전략의 주요 위험은 돈치안 채널의 폭이 항상 시장 위험을 정확하게 반영하지 않을 수 있다는 것입니다. 폭과 평균선 사이의 오차가있을 때 잘못된 신호로 이어질 수 있습니다. 이 시점에서 기계적으로 거래하는 것이 더 큰 손실로 이어질 수 있습니다.

또한 거래 매개 변수 설정은 전략 수익에도 상당한 영향을 미칩니다. 매개 변수 설정이 잘못되면 손실 가능성을 증가시킵니다.

마지막으로, 시장의 격렬한 변동의 조건에서, Donchian Channel 너비 지표의 효과도 할인 될 것이며 전략 신호는 지연 될 것입니다. 이 시점에서 전략을 중단하고 불필요한 손실을 피하기 위해 수동 개입이 필요합니다.

최적화 방향

이 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.

  1. 치안 채널 너비 표시기를 최적화하십시오. 가장 좋은 매개 변수 조합을 찾기 위해 다른 사이클 매개 변수를 테스트 할 수 있습니다.

  2. 확인을 위해 다른 2차 지표를 증가시킵니다. 예를 들어 변동성 및 볼륨과 같은 지표의 사용은 신호의 정확성을 향상시킬 수 있습니다.

  3. 스톱 로스 전략을 강화합니다. 합리적인 스톱 로스는 단일 손실의 크기를 크게 줄이고 전반적인 수익을 크게 향상시킬 수 있습니다.

  4. 매개 변수 자기 적응 최적화. 시장에 더 잘 적응하기 위해 실시간 시장 변화에 따라 거래 매개 변수를 동적으로 조정 할 수 있습니다.

  5. 알고리즘 거래 최적화. 더 지능적이고 미래 지향적인 전략을 만들기 위해 기계 학습과 같은 알고리즘 거래 기술을 도입하십시오.

요약

돈치안 채널 너비 거래 전략은 시장의 변동성과 위험 수준을 판단하여 대응하는 거래 결정을 내립니다. 이 전략의 가장 큰 장점은 위험을 효과적으로 제어하고 고위험 시장에서 주문을 쫓는 것을 피한다는 것입니다. 이 전략은 여러 차원에서 최적화되어 궁극적으로 안정적인 이익을 얻을 수 있습니다.


/*backtest
start: 2024-01-04 00:00:00
end: 2024-02-03 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 12/02/2018
// 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.
//
//You can change long to short in the Input Settings
//WARNING:
//- For purpose educate only
//- This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Donchian Channel Width Strategy")
length = input(50, minval=1)
smoothe = input(50, minval=1)
reverse = input(false, title="Trade reverse")
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))) 
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)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )  
plot(xDonchianWidth, color=blue, title="DCW")
plot(xSmoothed, color=red, title="sDCW")

더 많은