슈퍼트렌드 브레이크아웃 거래 전략

저자:차오장, 날짜: 2024-02-18 14:19:58
태그:

img

전반적인 설명

이 전략은 슈퍼트렌드 지표에 기초하여 개발됩니다. 이 지표는 가격 액션과 슈퍼트렌드 채널의 방향을 결합하여 시장 트렌드를 판단하고 채널 방향이 변경되면 거래 신호를 생성합니다.

가격이 슈퍼트렌드 채널을 통과하면, 장거리; 가격이 슈퍼트렌드의 하위 채널을 넘으면, 단축. 동시에, 트렌드 추적 스톱 로스 메커니즘이 있습니다.

전략 논리

슈퍼트렌드 채널은 상부 레일과 하부 레일로 구성된다. 채널 안쪽의 영역은 통합 영역이고 외부 영역은 트렌드 영역이다. 채널의 폭을 결정하기 위해 평균 실제 범위를 인수로 곱한다.

가격이 하단에서 상단 레일을 뚫을 때, 그것은 구매 신호입니다. 이것은 새로운 상승 추세가 시작된다는 것을 의미합니다. 가격이 상단에서 하단 레일을 뚫을 때, 그것은 판매 신호입니다. 이것은 새로운 하향 추세가 시작된다는 것을 의미합니다.

이 전략은 주요 트렌드 방향을 판단하기 위해 슈퍼트렌드 지표를 사용합니다. 채널 방향이 변경되면, 즉 가격이 채널 레일을 뚫을 때 거래 신호가 생성됩니다. 트렌드 추적 스톱 손실을 사용하여 이익을 잠금합니다.

이점 분석

이것은 비교적 간단하고 직관적인 브레이크아웃 전략입니다. 다음과 같은 장점이 있습니다:

  1. 슈퍼트렌드 채널을 사용하여 주요 트렌드 방향을 결정하고 소음 거래를 피합니다.

  2. 추세에 따라가세요. 채널과 가격의 관계를 바탕으로 장기 및 단기 기회를 판단하세요.

  3. 위험성을 효과적으로 통제하기 위한 명확한 스톱 로스 메커니즘이 있습니다.

  4. 스톱 로스 방법은 트렌드 추적 스톱 로스입니다. 이 방법은 수익 잠금을 최대화 할 수 있습니다.

위험 과 개선

또한 이 전략에는 다음과 같은 위험 요소가 있습니다.

  1. 슈퍼트렌드의 잘못된 매개 변수 설정은 잘못된 신호로 이어질 수 있습니다.

  2. 브레이크오웃 신호는 단기적인 반전 신호로 손실을 초래할 수 있습니다.

  3. 스톱 로스 방법은 트렌드 추적 스톱 로스 뿐이며, 이는 손실을 조기에 중단할 수 있습니다.

이에 따른 개선 조치는 다음과 같습니다.

  1. 다른 시장에서 데이터를 테스트하고 매개 변수를 최적화합니다.

  2. 필터 신호를 다른 지표와 결합하면 됩니다.

  3. 가격 구조와 결합된 브레이크오웃 신호의 신뢰성을 판단합니다.

  4. 배경 스톱 손실을 증가시켜 더 많은 위험을 제어합니다.

요약

일반적으로, 이 전략은 상대적으로 간단하고 직관적인 트렌드 다음 전략이다. 그것은 트렌드 방향을 명확하게 결정하기 위해 슈퍼트렌드 채널을 사용하고 채널이 방향을 변경할 때 신호를 생성한다. 그 다음 트렌드 추적 스톱 손실을 사용하여 이익을 잠금한다.

다른 지표와 비교했을 때, 슈퍼트렌드 채널은 가격 변동에 대한 더 나은 관용을 가지고 있습니다. 그러나 이 전략에는 여전히 이윤의 여지가 있습니다. 안정성을 더욱 향상시키기 위해 신호 필터링 및 스톱 로스 방법의 측면에서 최적화 될 수 있습니다.


/*backtest
start: 2023-02-11 00:00:00
end: 2024-02-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Supertrend TEST Strategy", overlay = true, format=format.price, precision=2)

Periods = input(title="ATR Period", type=input.integer, defval=4)
src = input(hlc3, title="Source")
Multiplier = input(title="ATR Multiplier", type=input.float, step=0.1, defval=4.7)
changeATR= input(title="Change ATR Calculation Method ?", type=input.bool, defval=true)
showsignals = input(title="Show Buy/Sell Signals ?", type=input.bool, defval=true)
highlighting = input(title="Highlighter On/Off ?", type=input.bool, defval=true)
tp=close
sl=close

atr2 = sma(tr, Periods)
atr= changeATR ? atr(Periods) : atr2
up=src-(Multiplier*atr)
up1 = nz(up[1],up)
up := close[1] > up1 ? max(up,up1) : up
dn=src+(Multiplier*atr)
dn1 = nz(dn[1], dn)
dn := close[1] < dn1 ? 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
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr, linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.green )
plotshape(buySignal and showsignals ? up : na, title="Лонг", text="Лонг", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green, textcolor=color.white )
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr, linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins", location=location.absolute, style=shape.circle, size=size.tiny, color=color.red )
plotshape(sellSignal and showsignals ? dn : na, title="Шорт", text="Шорт", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red, textcolor=color.white )
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) : color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) : color.white



if (strategy.position_size > 0)
	tp:=tp[1]
	sl:=up
	strategy.exit("Long_TP/SL","Long",limit=tp, stop=sl)
	
if (strategy.position_size < 0)
	tp:=tp[1]
	sl:=dn
	strategy.exit("Short_TP/SL","Short",limit=tp, stop=sl)



if buySignal 
	tp:=close+(close-up)*0.382
    strategy.entry("Long", strategy.long,  limit=tp, comment=tostring(round(tp)))
if sellSignal
	tp:=close-(dn-close)*0.382
    strategy.entry("Short", strategy.short, limit=tp, comment=tostring(round(tp)))




더 많은