
이 전략은 초 트렌드 지표 ((Supertrend) 와 다중 운동량 필터를 결합한 고급 트렌드 추적 시스템으로, 강력한 트렌드를 잡기 위해 특별히 설계되었다. 그 핵심은 ATR ((Average True Range) 를 이용한 동적으로 조정된 초 트렌드 지표이며, EMA ((Index Moving Average) 와 DEMA ((Double Index Moving Average) 를 트렌드 확인 도구로 사용하며, RSI ((Relatively Weak Indicators) 와 거래량 필터를 통합하여 진입 신호 신뢰도를 높인다. 이 전략은 ATR 기반의 중지, 중지 및 손실 추적 메커니즘을 내장하고 있으며, 다양한 거래 스타일에 맞는 여러 시간 주기 전설을 제공합니다.
이 전략의 핵심 원칙은 다층적인 신호 확인 메커니즘에 기반하여 포괄적인 거래 의사 결정 프레임워크를 구축하는 것입니다.
초전향 핵심 신호 시스템ATR을 이용한 동적 트렌드 대역을 계산하여, 종결 가격이 하향 궤도를 돌파할 때 구매 신호를 발생시키고, 하향 궤도를 돌파할 때 판매 신호를 발생시킨다. ATR의 주기 및 곱수는 다른 시장 환경에 맞는 변동성에 맞게 조정할 수 있다.
동력 확인 필터: 단기 EMA (설정 21 주기) 과 장기 DEMA (설정 200 주기) 위에 가격을 요구하여 거래 방향이 주요 추세와 일치하고 역전 거래가 방지됩니다.
신호 강도 검증: RSI (기본 요구>50) 를 통해 가격 동력을 확인하고, 거래량이 EMA (기본 20주기) 보다 크다는 것을 확인하여 시장 참여를 확인하고, 입시 신호의 품질을 향상시킵니다.
지능형 재입학: 확인된 상승 추세에서, 가격 회정을 거쳐 EMA에 다시 올라와 다른 조건이 충족되면, 전략은 다시 출전하여 추세가 지속되는 기회를 효과적으로 잡을 것입니다.
위험 관리 시스템:
다중주기 변수 사전 설정:
이 전략은 심도 있는 분석을 통해 다음과 같은 장점이 있습니다.
적응력트렌드 지표: 트렌드 지표는 ATR의 동적 조정에 기반하여 시장의 변동성에 자동으로 적응하여 다른 시장 환경에서 유효성을 유지할 수 있습니다.
여러 계층의 확인이 가짜 신호를 줄여줍니다.: EMA, DEMA, RSI 및 거래량에 대한 여러 가지 검증을 통해 가짜 신호의 위험을 크게 줄이고 거래 품질을 향상시킵니다.
“지능의 재입장”은 지속적 행동을 포착합니다.: 혁신적 재입장 논리는 상승 추세에서 회수 후 재입장을 허용하며, 동향의 변동성을 효과적으로 활용하여 자금 활용 효율성을 높인다.
완전한 위험 관리 시스템내장된 ATR 기반의 중지, 정지 및 추적 중지 메커니즘은 단일 거래 손실을 제한하고 수익을 보호하고 철회 위험을 줄일 수 있습니다.
다중 주기 사전 설정 간소화 동작: 다른 시간 프레임에 대한 기본 파라미터를 사용하여 다양한 거래 주기에서 전략을 쉽게 실행하여 다른 거래자의 시간 선호도에 맞게 조정합니다.
시각 보조 직관 명확: 색깔로 채워진 상승과 하락의 경향을 구분하고, 명확한 매매 신호 표시와 함께, 시장 상태를 명확하게 하고, 거래 결정을 편리하게 한다.
실제 테스트를 통해 검증된 결과: 일선 주기 상에서 약 60%의 승률과 4보다 큰 수익 인자를 나타냅니다. 특히 트렌드가 뚜렷한 시장 환경에 적합합니다.
이 전략은 포괄적으로 설계되었지만, 다음과 같은 잠재적인 위험들이 있습니다.
시장의 부진: 명확한 추세가 없는 평준화 시장에서, 자주 스톱로스를 유발하여 연속적으로 소액 손실이 쌓일 수 있다. 해결책은 시장 구조가 불확실할 때 거래를 중지하거나, 신호 감수성을 낮추기 위해 ATR의 배수를 증가시키는 것이다.
필터링 조건은 일부 기회를 놓칠 수 있습니다.여러 필터링 조건은 신호 품질을 향상시키지만 초기 트렌드 기회를 놓치게 할 수 있습니다. 거래자는 개인 위험 취향에 따라 필터링 조건의 엄격함을 조정하는 것을 고려할 수 있습니다.
매개변수 민감도: ATR 주기 및 배수 설정은 전략 성능에 중요한 영향을 미치며, 다른 시장 환경에는 다른 매개 변수가 필요할 수 있습니다. 피드백을 통해 특정 시장의 매개 변수 설정을 최적화하는 것이 좋습니다.
탈퇴 위험: 재검토는 전체 포지션을 사용할 때 큰 인출이 발생할 수 있음을 나타냅니다. (최대 100%+) 펀드 관리가 엄격하게 수행되어야하며 거래 당 위험은 1-2% 이내에 제어됩니다.
역사적인 데이터의 한계전략은 주로 특정 시장과 시간 동안 재검토되며, 과도한 적합성의 위험이 있을 수 있다. 실제 적용 전에 더 광범위한 시장과 시간 동안의 테스트가 이루어져야 한다.
극한시장 조건 테스트의 부재이 전략은 시장의 급격한 변동이나 유동성 위기 같은 극단적인 상황에 대한 테스트를 거치지 않았을 수 있으며, 이러한 상황에서 수행되는 것은 알려져 있지 않다.
코드의 깊이 분석을 통해, 이 전략은 다음과 같은 방향으로 최적화될 수 있다:
적응 변수 조정: 시장의 변동성에 기반한 ATR 곱셈과 주기 조정 메커니즘을 개발하여 전략이 시장 상태의 변화에 자동으로 적응할 수 있도록 한다. 예를 들어, 변동성이 증가할 때 ATR 곱셈을 높이고, 변동성이 감소할 때 ATR 곱셈을 줄인다.
통합 시장 상태 분류: 시장 상태를 인식하는 모듈을 도입한다 (예: 부린 대역폭, ADX 등을 사용한다). 시장이 트렌드 상태인지 흔들림 상태인지에 따라 전략 매개 변수를 자동으로 조정하거나 거래를 일시 중지한다.
다주기 분석 프레임워크: 더 높은 시간 프레임 트렌드가 현재 시간 프레임과 일치하기 전에 거래를 수행하도록 요구하는 다중 주기 분석 기능을 추가하고, 트렌드 판단의 정확성을 향상시킵니다.
다시 입학 논리를 최적화: 재입장 조건의 정교화, 피보나치 리콜 레벨 또는 핵심 지점 확인을 추가하여 재입장 지점의 정확성을 향상시킬 수 있습니다.
자금 관리 최적화: 역동적인 포지션 관리를 구현하여 시장의 변동성, 계좌의 순가치 및 연속 적자 상태에 따라 포지션 크기를 자동으로 조정하고, 자본 곡선의 성능을 최적화한다.
시장 감정 지표 추가: 시장 감정 지표인 VIX 지수 (변동률 지수) 또는 거래량 변화율과 같은 시장 감정 지표를 통합하여 시장의 공포 또는 과도한 낙관주의에 따라 전략 행동을 조정한다.
기계 학습 최적화: 기계 학습 알고리즘을 사용하여 매개 변수 선택 및 입시 시기를 최적화하고, 역사 데이터 훈련 모델을 통해 최적의 거래 매개 변수 조합을 예측한다.
다주기 초상향 EMA 동력 필터링 전략은 잘 설계된 트렌드 추적 시스템으로 초상향 지표와 다중 동력 필터를 결합하여 포괄적인 거래 의사 결정 프레임 워크를 구축한다. 그것의 핵심 장점은 자기 적응력이 강하고, 거짓 신호를 줄이는 다층 확인, 지속적 행동을 포착하는 지능적인 재입장 및 완전한 위험 관리 시스템이다. 이 전략은 특히 트렌드가 명백한 시장 환경에 적합하며, 일선 주기에서 좋은 피드백을 보여준다.
그러나, 이 전략은 흔들리는 시장에서 잘 작동하지 않을 수 있으며, 변수 감수성과 잠재적인 회수 위험이 있습니다. 전략의 안정성을 더욱 향상시키기 위해, 적응 변수 조정, 시장 상태 분류를 통합하는, 다주기 분석 프레임 워크를 구축하는, 재입장 논리를 최적화하는, 자금 관리를 개선하는, 시장 감정 지표를 증가시키는, 그리고 기계 학습 기술을 적용하는 것을 고려할 수 있습니다.
궁극적으로, 이 전략은 트렌드 추적 거래에 대한 엄격한 기술 지표, 완벽한 위험 관리의 프레임 워크를 제공하지만, 항상 위험 통제의 중요성을 염두에 두고, 각 거래의 위험을 허용 가능한 범위로 제한하고, 개인 거래 스타일과 시장 환경에 따라 전략 파라미터를 적절하게 조정합니다.
/*backtest
start: 2024-08-15 00:00:00
end: 2025-08-13 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("Supertrend EMA Strategy _V29", overlay=true, format=format.price, precision=2, initial_capital=1000)
// Inputs
tf_preset = input.string("Manual", title="Timeframe Preset", options=["Manual", "Auto-1H/4H", "Auto-1D", "Auto-1W"])
atr_period = input.int(10, title="ATR Period")
src = hl2
atr_multiplier = input.float(3.0, title="ATR Multiplier", step=0.1)
change_atr = input.bool(true, title="Change ATR Calculation Method?")
show_signals = input.bool(true, title="Show Buy/Sell Signals?")
highlighting = input.bool(true, title="Highlighter On/Off?")
ema_length = input.int(21, title="EMA Length")
dema_length = input.int(200, title="DEMA Length")
tp_multiplier = input.float(3.0, title="Take Profit Multiplier (ATR, 0=off)", step=0.5)
allow_long = input.bool(true, title="Allow Long Trades")
allow_short = input.bool(false, title="Allow Short Trades")
sl_multiplier = input.float(1.0, title="Stop Loss Multiplier (ATR, 0=off)", step=0.5)
use_vol_filter = input.bool(true, title="Use Volume Filter?")
vol_ema_length = input.int(20, title="Volume EMA Length", minval=1)
use_rsi_filter = input.bool(true, title="Use RSI Filter?")
rsi_length = input.int(14, title="RSI Length")
rsi_threshold = input.int(50, title="RSI Buy Threshold")
// Auto-adjust
int atr_period_final = atr_period
float atr_mult_final = atr_multiplier
string preset_label = tf_preset
if tf_preset == "Auto-1H/4H"
atr_period_final := 10
atr_mult_final := 3.0
preset_label := "1H/4H"
else if tf_preset == "Auto-1D"
atr_period_final := 14
atr_mult_final := 3.0
preset_label := "Daily"
else if tf_preset == "Auto-1W"
atr_period_final := 20
atr_mult_final := 4.0
preset_label := "Weekly"
// Show settings
if barstate.islast
label.new(x=bar_index[barstate.isrealtime ? 0 : 50], y=high, text="Preset: " + preset_label + "\nATR: " + str.tostring(atr_period_final) + "\nMult: " + str.tostring(atr_mult_final), color=color.white, style=label.style_label_left, textcolor=color.black, size=size.small, yloc=yloc.abovebar)
// Calculations
atr2 = ta.sma(ta.tr, atr_period_final)
atr = change_atr ? ta.atr(atr_period_final) : atr2
up = src - (atr_mult_final * atr)
up1 = nz(up[1], up)
up := close[1] > up1 ? math.max(up, up1) : up
dn = src + (atr_mult_final * atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? math.min(dn, dn1) : dn
trend = 1
trend := nz(trend[1], trend)
trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
buy_signal = trend == 1 and trend[1] == -1
sell_signal = trend == -1 and trend[1] == 1
ema = ta.ema(close, ema_length)
ema1 = ta.ema(close, dema_length)
dema = 2 * ema1 - ta.ema(ema1, dema_length)
vol_ema = ta.ema(volume, vol_ema_length)
rsi = ta.rsi(close, rsi_length)
// Plots (global)
up_plot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
dn_plot = plot(trend == -1 ? dn : na, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
plot(dema, title="DEMA 200", color=color.blue, style=plot.style_linebr, linewidth=2)
plotshape(buy_signal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green)
plotshape(buy_signal and show_signals ? up : na, title="Buy", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white)
plotshape(sell_signal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red)
plotshape(sell_signal and show_signals ? dn : na, title="Sell", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white)
m_plot = plot(ohlc4, title="", style=plot.style_circles, linewidth=1)
long_fill_color = highlighting ? (trend == 1 ? color.new(color.green, 90) : color.white) : color.white
short_fill_color = highlighting ? (trend == -1 ? color.new(color.red, 90) : color.white) : color.white
fill(m_plot, up_plot, title="UpTrend Highlighter", color=long_fill_color)
fill(m_plot, dn_plot, title="DownTrend Highlighter", color=short_fill_color)
plot(ema, title="EMA", color=color.blue, linewidth=2)
// Strategy Logic with Re-Entry (in if for skip)
var float entry_price = na
vol_condition = not use_vol_filter or volume > vol_ema
rsi_condition = not use_rsi_filter or rsi > rsi_threshold
buy_cond_met = buy_signal and close > ema and close > dema and allow_long and vol_condition and rsi_condition
re_entry_cond = trend == 1 and strategy.position_size == 0 and close[1] < ema and close > ema and close > dema and vol_condition and rsi_condition
sell_cond_met = sell_signal and strategy.position_size > 0 and (close < dema or true)
if buy_cond_met or re_entry_cond
strategy.entry("Long", strategy.long)
entry_price := close
if sell_cond_met
strategy.close("Long")
entry_price := na
if sell_signal and close < ema and close < dema and allow_short and vol_condition
strategy.entry("Short", strategy.short)
entry_price := close
if buy_signal and strategy.position_size < 0
strategy.close("Short")
entry_price := na
// SL & TP with Trailing
if strategy.position_size != 0 and not na(entry_price)
if sl_multiplier > 0
sl_price = strategy.position_size > 0 ? entry_price - (sl_multiplier * atr) : entry_price + (sl_multiplier * atr)
trail_condition = strategy.position_size > 0 ? (close - entry_price > atr) : (entry_price - close > atr)
trail_sl = strategy.position_size > 0 ? up : dn
final_sl = trail_condition ? trail_sl : sl_price
strategy.exit("SL Exit", stop=final_sl)
if tp_multiplier > 0
tp_price = strategy.position_size > 0 ? entry_price + (tp_multiplier * atr) : entry_price - (tp_multiplier * atr)
strategy.exit("TP Exit", limit=tp_price)
// Alerts
alertcondition(buy_signal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sell_signal, title="SuperTrend Sell", message="SuperTrend Sell!")
change_cond = trend != trend[1]
alertcondition(change_cond, title="SuperTrend Direction Change", message="SuperTrend has changed direction!")