3중 지표 클라우드 패턴을 기반으로 한 추세 추종 전략


생성 날짜: 2023-09-13 17:38:55 마지막으로 수정됨: 2023-09-13 17:38:55
복사: 0 클릭수: 669
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

이 전략의 이름은 트리플 지표 클라우드 형태를 기반으로 한 트렌드 추적 전략입니다. 이 전략은 3 가지 다른 유형의 트렌드 지표를 사용하여 클라우드 형태를 형성하고, 가격이 클라우드 형태를 돌파 할 때 트렌드 추적 거래를합니다.

이 전략은 다음과 같은 세 가지 지표를 가지고 있습니다.

카우프만은 이동 평균에 적응하여 시장의 변동에 민감하게 반응합니다.

헐 이동 평균, 부드러운 회전 특징, 가짜 신호를 필터링;

가격 관통을 구축하고, 하락의 추종을 피하기 위해 초고향 상쇄 제도를 구축한다.

이 세 가지는 함께 구름 형태를 형성하며, 구름 꼭대기는 세 가지의 최고 값의 연결고리이며, 구름 바닥은 최소 값의 연결고리이다.

구체적인 거래 논리:

K선 고점이 구름 꼭대기를 돌파할 때, 상승 추세 통로를 돌파하는 것을 나타내고, 구매 신호를 생성합니다.

K선 종전 가격이나 낮은 지점 아래로 구름 바닥을 뚫었을 때, 하향 추세가 시작되었다는 것을 나타냅니다.

이 전략의 장점은 지표 조합이 트렌드 상태를 판단하는 데 더 정확하고 가짜 신호를 줄이는 것이다. 그러나 매개 변수 최적화는 여전히 중요합니다.

전체적으로, 다중 지표 통합 판단 경향은 흔하고 효과적인 방법입니다. 그러나 거래자는 여전히 충분한 판단력과 전략 조정의 유연성을 유지해야합니다.

전략 소스 코드
/*backtest
start: 2022-09-12 00:00:00
end: 2023-02-03 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © SnarkyPuppy

//@version=5
strategy("HKST Cloud", overlay=true, default_qty_type= strategy.percent_of_equity, default_qty_value=100)



////////////////nAMA
Lengthkaufman = input(20) 
xPrice = ohlc4
xvnoise = math.abs(xPrice - xPrice[1])
nfastend = 0.666
nslowend = 0.0645
nsignal = math.abs(xPrice - xPrice[Lengthkaufman])
nnoise = math.sum(xvnoise, Lengthkaufman)
nefratio = nnoise != 0? nsignal / nnoise : 0
nsmooth = math.pow(nefratio * (nfastend - nslowend) + nslowend, 2) 
nAMA =  float(0)
nAMA := nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))

//plot(nAMA,color=color.red)
///short=input(true)



///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////

////////hull moving average
hull_len=input(20)
hull= ta.hma(nAMA,hull_len)

///////atr trail
atr_factor=input(2)
atr_period=input(5)
[supertrend, direction] = ta.supertrend(atr_factor,atr_period)

/////////cloud
band1= math.max(supertrend,hull,nAMA)
band2= math.min(supertrend,hull,nAMA)

b1=plot(band1, "band1", color = color.rgb(76, 175, 79, 85), style=plot.style_linebr)
b2=plot(band2, "band2", color = color.rgb(255, 82, 82, 78), style=plot.style_linebr)
fill(b1,b2,color.rgb(12, 50, 186, 75))
longCondition = ta.crossover(high,band1) //or ta.crossover(low,band2)
if (longCondition)
    strategy.entry("Up", strategy.long)

shortCondition =  ta.crossunder(low,band2) or close<band2
if (shortCondition) 
    strategy.close("Up", shortCondition)