
이 전략은 트렌드 추적과 입장을 구현하기 위해 쌍 지수 이동 평균과 알마 지표를 결합합니다. 그 중 알마 라인이 주요한 트렌드 필터로써, 가격이 알마 라인 위에 할 때 더하고, 가격이 알마 라인 아래에 할 때 더 텅 비습니다. 쌍 지수 이동 평균은 일찍 입장을 위해 사전 트렌드 신호를 제공하기 위해 사용됩니다.
해결책:
이 전략은 이중 지수 이동 평균과 알마 지표와 결합하여 트렌드의 시간적 추적과 신뢰할 수 있는 입문 필터를 구현한다. 파라미터를 최적화하고 손실을 막는 전략의 개선을 통해 잘못된 신호를 더욱 줄이고 위험을 제어하고 전략의 효과를 향상시킬 수 있다. 이 전략은 트렌드적인 행동, 특히 중장기 거래에 적합하다.
/*backtest
start: 2022-12-15 00:00:00
end: 2023-12-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
//Author: HighProfit
//Lead-In
strategy("Double Exponential Moving Avarage & Arnoud Legoux Moving Avarage Strategy", shorttitle="ST-DEMA+ALMA", overlay=true)
//Arnoud Legoux Moving Avarage Inputs
source = close
windowsize = input(title="Window Size", defval=50)
offset = input(title="Offset", type=float, defval=0.85)
sigma = input(title="Sigma", type=float, defval=6)
//Exponential Moving Avarage Inputs
L1= input(5,"EMA-1")
L2= input(10,"EMA-2")
//Exponential Moving Avarage Calculations
e1= ema(close, L1)
e2= ema(close, L2)
//Conditions
longCondition = e1 and e2 > alma(source, windowsize, offset, sigma)
if (longCondition)
strategy.entry("Long", strategy.long)
shortCondition = e1 and e2 < alma(source, windowsize, offset, sigma)
if (shortCondition)
strategy.entry("Short", strategy.short)
//Plots
plot(alma(source, windowsize, offset, sigma), color=lime, linewidth=1, title="ALMA")
plot(e1, color=orange, linewidth=1, title="EMA-1")
plot(e2, color=blue, linewidth=1, title="EMA-2")