
이 전략은 패러폴리 라인 SAR (스톱 로드 리버스) 지표와 EMA 평행선을 결합하여 필터링하여 거래 신호의 정확성을 향상시킵니다. 이 전략은 트렌드를 추적하는 거래자에게 적합합니다.
SAR가 가격 아래에 있고 가격이 느린 EMA 평균선 + 편향량보다 높을 때 다중 신호가 발생하고 SAR가 가격 위에 있고 가격이 느린 EMA 평균선 + 편향량보다 낮을 때 공백 신호가 발생한다. 동시에, 빠른 EMA 평균선과 느린 EMA 평균선의 교차로 추가 필터링을 한다. 이렇게 SAR 지표가 단독으로 사용되었을 때 발생할 수있는 잘못된 신호를 피할 수 있다.
구체적으로, 다중 신호의 촉발 조건은 1) SAR가 어제의 종결 가격 아래에 있고 현재의 종결 가격 위에 있습니다. 2) 현재 종결 가격이 느린 EMA 평균과 편향량보다 높거나 빠른 EMA 평균 아래의 느린 EMA 평균을 통과합니다. 3) 현재 종결 가격은 SAR 값과 느린 EMA 평균과 편향량보다 높습니다.
공백 신호의 촉발 조건은 1) SAR가 어제의 종결 가격 위에 있고 현재 종결 가격 아래에 있다. 2) 현재 종결 가격이 느린 EMA 평균선 반도치 또는 빠른 EMA 평균선 위에 느린 EMA 평균선을 통과한다. 3) 현재 종결 가격이 SAR 값과 느린 EMA 평균선 반도치보다 낮다.
이 전략은 SAR 지표와 EMA 일선 필터링을 결합하여 트렌드 방향을 더 잘 식별하고 잘못된 신호를 줄일 수 있습니다.
장점은 다음과 같습니다.
이 전략에는 다음과 같은 위험도 있습니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
이 전략은 SAR 지표와 EMA 평행선의 장점을 종합적으로 활용하여 보다 유연한 트렌드 추적 전략을 설계했다. 전반적으로, 이 전략은 트렌드 방향을 성공적으로 식별하는 능력이 강하여 트렌드 추적에서 더 나은 효과를 얻을 수 있다. 매개 변수 최적화 및 위험 관리를 통해 전략의 안정성과 수익성을 더욱 강화할 수 있다. 이 전략은 위험 관리 인식과 매개 변수 최적화 능력을 갖춘 투자자에게 적합하다.
/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("SAR Trend Trader Strategy By: jhanson107", shorttitle="SAR Trend Trader Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
SlowEMALength = input(100, "Slow EMA Length")
FastEMALength = input(10, "Fast EMA Length")
emaoffset = input(1.00, "EMA Offset %")
start = input(0.01)
increment = input(0.005)
maximum = input(0.08)
////////////////////////////////////////////////////////////////////////////////
// BACKTESTING RANGE
// From Date Inputs
fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input(defval = 2019, title = "From Year", minval = 1970)
// To Date Inputs
toDay = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
toMonth = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
toYear = input(defval = 2020, title = "To Year", minval = 1970)
// Calculate start/end date and time condition
startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = true
////////////////////////////////////////////////////////////////////////////////
psar = sar(start, increment, maximum)
ema = ema(close, SlowEMALength)
fastema = ema(close, FastEMALength)
offset = (emaoffset / 100) * ema
// Signals
long = high[1] < psar[2] and high >= psar[1] and close > ema + offset or crossunder(ema, fastema) and close > psar and close > ema + offset
short = low[1] > psar[2] and low <= psar[1] and close < ema - offset or crossover(ema, fastema) and close < psar and close < ema - offset
// Plot PSAR
plot(psar, title="PSAR", color = low < psar and not long ? green : red, trackprice=true)
//Barcolor
barcolor(close > psar and close > ema + offset and fastema > ema ? green : na)
barcolor(close > psar and close < ema + offset or close > psar and fastema < ema ? white : na)
barcolor(close < psar and close < ema - offset and fastema < ema and close? red : na)
barcolor(close < psar and close > ema - offset or close < psar and fastema > ema ? white : na)
//Plot EMA
plot(ema, color=blue, linewidth=1, transp=0, title="Slow EMA")
plot(fastema, color=purple, linewidth=1, transp=0, title="Fast EMA")
if(high > psar)
strategy.close("Short")
if(low < psar)
strategy.close("Long")
if(long and time_cond)
strategy.entry("Long", strategy.long, comment="Long")
if(short and time_cond)
strategy.entry("Short", strategy.short, comment="Short")
if (not time_cond)
strategy.close_all()