이 전략은 TEMA, DEMA, HMA의 3가지 다른 유형의 이동 평균의 조합을 통해 중장기 평균 TEMA와 DEMA가 금포크/죽은 포크 신호를 발산할 때 출전하고, 장기 평균 HMA를 사용하여 트렌드 방향을 판단하여 역동 거래 신호를 필터링합니다.
구체적으로, 이 전략은 동시에 이중 지수 이동 평균 DEMA를 사용하여 중기 추세를 판단하고, 3 지수 이동 평균 TEMA를 사용하여 단기 추세를 판단하고, 밀집형 이동 평균 HMA를 사용하여 장기 추세를 판단한다. 단기 중기는 같은 방향으로 시작 (TEMA와 DEMA의 동향 돌파) 하고, 장기 주류 추세도 동향 (HMA의 방향과 돌파 일치) 할 때만 거래 신호가 발생한다.
다단계 변수 테스트를 통해 최적의 변수 조합을 찾아, 손해 방지 전략을 도입하고, 적절한 진출 조건을 완화하는 등의 방법으로 위험을 관리할 수 있다.
이 전략은 복합적으로 여러 가지 평평선 지표를 사용하여 추세를 판단한다. 장점은 신호 생성이 명확하고, 구성 가능한 공간이 넓다는 것이다. 단점은 지연 위험과 다중 변수 의존성이 있다는 것이다. 파라미터 최적화, 스톱 손실 전략과 같은 제어 가능한 위험을 통해 복합적인 평평선의 장점을 발휘한다. 이 전략은 거래자가 트렌드 거래 기술을 완전히 파악할 수 있도록 돕는다.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tuned-com
//@version=4
strategy("TEMA/DEMA/HMA", overlay=true, pyramiding=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=1000000, commission_type=strategy.commission.percent, commission_value=0.1)
Tlength = input(8, title="TEMA Length", minval=1)
Dlength = input(43, title="DEMA Length", minval=1)
Hlength = input(52, title="Hull Length", minval=1)
Rlength = input(2, title="Hull Trend Test Length", minval=1)
//TEMA//
ema1 = ema(close, Tlength)
ema2 = ema(ema1, Tlength)
ema3 = ema(ema2, Tlength)
tema = 3 * (ema1 - ema2) + ema3
//DEMA//
e1 = ema(close, Dlength)
e2 = ema(e1, Dlength)
dema = 2 * e1 - e2
//HMA//
hma = wma(2 * wma(close, Hlength / 2) - wma(close, Hlength), round(sqrt(Hlength)))
up = crossunder(dema, tema) and rising(hma, Rlength)
down = crossover(dema, tema) and falling(hma, Rlength)
downc = crossunder(dema, tema)
upc = crossover(dema, tema)
plot(dema, color=color.green, linewidth=2)
plot(tema, color=color.aqua, linewidth=2)
plot(hma, color=rising(hma, Rlength) ? color.green : na, linewidth=2, transp=0)
plot(hma, color=falling(hma, Rlength) ? color.red : na, linewidth=2, transp=0)
bgcolor(rising(hma, Rlength) ? color.green : na, transp=70)
bgcolor(falling(hma, Rlength) ? color.red : na, transp=70)
plotarrow(tema - dema, colorup=color.green, colordown=color.red, transp=70)
if up
strategy.entry("Long Entry", strategy.long)
if down
strategy.entry("Short Entry", strategy.short)