
이것은 SuperTrend, VWAP, EMA, 그리고 ADX의 여러 기술 지표를 결합한 트렌드 추적 거래 전략이다. 이 전략은 주로 SuperTrend 지표를 통해 트렌드 방향을 식별하고 VWAP와 EMA의 위치 관계를 사용하여 트렌드를 확인하며, ADX 지표를 사용하여 약한 트렌드를 필터링하여 높은 정확도 거래 신호를 제공합니다. 전략 설계는 낮 거래, 특히 5 분, 15 분, 1 시간 등의 시간에 적합하다.
이 전략의 핵심 논리는 다음과 같은 몇 가지 핵심 요소에 기반합니다.
이것은 구조적으로 완전하고 논리적으로 명확한 트렌드 추적 전략이다. 다중 지표의 조합 사용으로 거래 신호의 신뢰성을 효과적으로 향상시킨다. 전략의 장점은 신호가 명확하고 실행하기 쉽고, 동시에 좋은 확장성이 있다는 것이다. 그러나 실제 응용에서는 시장 환경에 대한 선택에 주의를 기울이고, 위험을 잘 통제해야 한다. 지속적인 최적화 및 개선으로, 이 전략은 트렌드성이 강한 시장에서 안정적인 수익을 얻을 수 있다.
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-08 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("SuperTrend on Steroids", overlay=true)
// Input parameters
atrLength = input(10, title="ATR Period")
atrMultiplier = input(3.0, title="ATR Multiplier")
emaLength = input(21, title="EMA Length")
adxLength = input(14, title="ADX Length")
adxSmoothing = input(14, title="ADX Smoothing")
// EMA Calculation
emaValue = ta.ema(close, emaLength)
// VWAP Calculation
vwapValue = ta.vwap(close)
// ATR Calculation
atrValue = ta.atr(atrLength)
// SuperTrend Calculation
var trend = 1
up = hl2 - atrMultiplier * atrValue
dn = hl2 + atrMultiplier * atrValue
up1 = nz(up[1], up)
dn1 = nz(dn[1], dn)
up := close[1] > up1 ? math.max(up, up1) : up
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
// ADX Calculation
[diplus, diminus, adx] = ta.dmi(adxLength, adxSmoothing)
// Buy/Sell Signals
buySignal = trend == 1 and trend[1] == -1
sellSignal = trend == -1 and trend[1] == 1
// Executing Trades
if buySignal
strategy.entry("Long", strategy.long)
if sellSignal
strategy.close("Long")
// Plotting SuperTrend Line
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_line, color=color.yellow, linewidth=2)
dnPlot = plot(trend == -1 ? dn : na, title="Down Trend", style=plot.style_line, color=color.red, linewidth=2)
// Buy/Sell Labels
plotshape(buySignal, title="Buy Signal", text="BUY", location=location.belowbar, style=shape.labelup, size=size.normal, color=color.green, textcolor=color.white, offset=-1)
plotshape(sellSignal, title="Sell Signal", text="SELL", location=location.abovebar, style=shape.labeldown, size=size.normal, color=color.red, textcolor=color.white, offset=1)
// Background Highlighting
fill(upPlot, dnPlot, color=trend == 1 ? color.new(color.green, 90) : color.new(color.red, 90), title="Trend Highlight")
//vwap and EMA
plot(emaValue, title="EMA", color=color.white, linewidth=2)
plot(vwapValue, title="VWAP", color=color.blue, linewidth=2)