
이 전략은 변동성 비율 정지(VStop) 지표와 지수 이동 평균(EMA)을 기반으로 하는 추세 추종 거래 시스템입니다. 이 전략은 스탠 와인스타인의 거래 철학을 결합하여 동적으로 조정되는 손절 수준을 통해 자금 관리를 최적화하고, EMA를 사용하여 추세 방향을 확인합니다. 이러한 조합은 투자자와 스윙 트레이더에게 추세를 포착하면서 효과적으로 위험을 관리할 수 있는 거래 프레임워크를 제공합니다.
전략의 핵심 논리는 두 가지 주요 기술 지표에 기초합니다.
변동성 정지(VStop): 시장 변동성에 따라 정지 위치를 적응적으로 조정하는 ATR(Average True Range) 기반의 동적 정지 지표입니다. 가격이 상승 추세일 때, 손절매선은 가격 상승에 따라 위로 이동합니다. 추세가 반전되면 손절매선의 방향이 바뀌어 다시 계산됩니다.
지수 이동 평균(EMA): 추세 확인 도구 역할을 하며 잘못된 신호를 걸러내는 데 도움이 됩니다. 포지션을 열기 전에 가격이 EMA보다 높아야 하며, 이를 통해 거래 방향이 주요 추세와 일치하도록 보장됩니다.
거래 신호 생성 논리는 다음과 같습니다.
이 전략은 변동성 손절매와 이동평균선 시스템을 결합하여 완전한 추세 추종 거래 프레임워크를 구축합니다. 이 전략의 주요 장점은 적응성과 위험 관리 능력에 있지만, 시장 환경이 전략 성과에 미치는 영향에도 주의를 기울여야 합니다. 지속적인 최적화와 개선을 통해 이 전략은 다양한 시장 환경에서도 안정적인 성과를 유지할 것으로 기대됩니다. 실제 거래에 적용하기 전에 거래자는 매개변수 설정을 완전히 테스트하고 자신의 위험 허용 범위에 따라 전략을 조정하는 것이 좋습니다.
/*backtest
start: 2024-12-17 00:00:00
end: 2025-01-16 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("VStop + EMA Strategy", overlay=true)
// VStop Parameters
length = input.int(20, "VStop Length", minval=2)
multiplier = input.float(2.0, "VStop Multiplier", minval=0.25, step=0.25)
// EMA Parameters
emaLength = input.int(30, "EMA Length", minval=1)
// VStop Calculation
volStop(src, atrlen, atrfactor) =>
if not na(src)
var max = src
var min = src
var uptrend = true
var float stop = na
atrM = nz(ta.atr(atrlen) * atrfactor, ta.tr)
max := math.max(max, src)
min := math.min(min, src)
stop := nz(uptrend ? math.max(stop, max - atrM) : math.min(stop, min + atrM), src)
uptrend := src - stop >= 0.0
if uptrend != uptrend[1] and not barstate.isfirst
max := src
min := src
stop := uptrend ? max - atrM : min + atrM
[stop, uptrend]
// Calculate VStop
[vStop, isUptrend] = volStop(close, length, multiplier)
// Plot VStop
plot(vStop, "Volatility Stop", style=plot.style_cross, color=isUptrend ? color.teal : color.red)
// Calculate 30 EMA
emaValue = ta.ema(close, emaLength)
plot(emaValue, "EMA", color=color.blue)
// Entry and Exit Conditions
longCondition = isUptrend and close > emaValue
exitCondition = close <= emaValue
// Strategy Execution
if longCondition and not strategy.opentrades
strategy.entry("Long", strategy.long)
if exitCondition and strategy.opentrades
strategy.close("Long")
// Display Strategy Info
bgcolor(isUptrend ? color.new(color.teal, 90) : color.new(color.red, 90), title="Trend Background")