선니 슈퍼트렌드 전략

저자:차오장, 날짜: 2023-12-13 14:40:24
태그:

img

전반적인 설명

썬니 슈퍼트렌드 전략은 ATR 및 슈퍼트렌드 지표를 기반으로하는 트렌드를 따르는 전략이다. 트렌드 반전을 정확하게 예측할 수 있으며 타이밍 지표로 완벽하게 작동합니다. 전략은 인내심을 높이고 거래자가 적절한 시간에 시장에 진입하고 빠져나가는 데 도움이 될 수 있습니다.

전략 논리

이 전략은 현재 트렌드 방향을 결정하기 위해 슈퍼트렌드 지표를 사용합니다. 슈퍼트렌드 지표가 방향을 변경하면 트렌드 반전이 발생할 수 있다고 생각합니다. 또한 전략은 보조 판단을 위해 촛불 몸의 방향을 사용합니다. 잠재적 인 반전 신호가 나타나고 촛불 몸의 방향이 이전 방향과 일치하면 유효하지 않은 신호가 필터됩니다.

구체적으로, 전략은 다음과 같은 논리에 따라 거래 신호를 생성합니다:

  1. 주요 트렌드 방향을 결정하기 위해 슈퍼 트렌드 지표를 사용
  2. 슈퍼 트렌드 지표 방향이 변경되면 잠재적 인 반전 신호가 생성됩니다.
  3. 촛불체 방향이 이 시간에 이전과 일치하는 경우, 역전 신호는 필터로
  4. 촛불 몸의 방향이 변경되면, 반전 신호가 확인되고 거래 신호가 생성됩니다.

이점 분석

  1. 슈퍼트렌드 지표를 기반으로 트렌드 반전 지점을 정확하게 결정할 수 있습니다.
  2. 신호 품질을 향상시키기 위해 촛불체 방향을 결합하여 유효하지 않은 신호를 필터
  3. 투자자들이 합리적인 입출시기를 선택하도록 안내하는 시점 지표로 적합합니다.
  4. 모든 기간과 다양한 품종에 널리 적용되며 높은 적응력을 갖습니다.

위험 과 해결책

  1. 슈퍼트렌드 지표는 필터링이 필요한 과잉 신호를 생성하는 경향이 있습니다. 솔루션: 이 전략은 유효하지 않은 신호를 효과적으로 필터링하기 위해 보조 판단을 위해 촛불체 방향을 사용합니다

  2. 슈퍼트렌드 매개 변수는 과도한 최적화에 유연합니다.
    솔루션: 기본 매개 변수를 사용하여 수동 조정 및 과잉 최적화를 피합니다.

  3. 초고속 트렌드 반전을 처리할 수 없습니다. 해결책: 더 빠른 시장 움직임에 대응하기 위해 ATR 기간 매개 변수를 적절히 조정합니다.

최적화 방향

  1. ATR 기간 매개 변수의 다른 조합을 시도
  2. 신호 필터링을 돕기 위해 볼륨 또는 변동성 표시기를 추가
  3. 전략 성과를 향상시키기 위해 다른 시스템과 결합
  4. 단일 손실을 통제하기 위한 스톱 로스 메커니즘 개발

결론

썬니 슈퍼트렌드 전략은 슈퍼트렌드 지표를 기반으로 한 효율적인 트렌드 역전 전략이다. 보조 판단을 위해 촛불체 방향을 결합하여 유효하지 않은 신호를 효과적으로 필터링하고 신호 품질을 향상시킬 수 있습니다. 이 전략은 작동이 간단하고 매우 적응 가능하며 여러 제품과 시간 프레임에 걸쳐 광범위하게 사용할 수 있습니다. 매개 변수를 합리적으로 최적화하고 스톱 로스 메커니즘을 증가시킴으로써 전략의 성능을 더욱 향상시킬 수 있습니다.


/*backtest
start: 2023-11-12 00:00:00
end: 2023-12-12 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Sunny Supertrend Strategy", overlay=true, default_qty_type=strategy.percent_of_equity)

atrPeriod = input(10, "ATR Length")
factor = input.float(3.0, "Factor", step = 0.01)

[_, direction] = ta.supertrend(factor, atrPeriod)

shor= close > open and close[1] > open[1] and close[2] > open[2] 
lon = open > close and open[1] > close[1] and  open[2] > close[2]
tt= ta.change(direction) < 0
ss= ta.change(direction) > 0
long= tt
longexit = lon or ss
short= ss
shortexit = shor or tt

longPosMem = false
longexitPosMem = false
shortPosMem = false
shortexitPosMem = false

longPosMem := long ? true : short ? false : longPosMem[1]
longexitPosMem := longexit ? true : shortexit ? false : longexitPosMem[1]
shortPosMem := short ? true : long ? false : shortPosMem[1]
shortexitPosMem := shortexit ? true : longexit ? false : shortexitPosMem[1]

longy = long and not(longPosMem[1])
longexity = longexit and not(longexitPosMem[1])
shorty = short and not(shortPosMem[1])
shortexity = shortexit and not(shortexitPosMem[1])

//Use this to customize the look of the arrows to suit your needs.
plotshape(longy, location=location.abovebar, color=color.green, style=shape.arrowup, text="Buy")
plotshape(longexity, location=location.top, color=color.green, style=shape.xcross, text="Buy exit")
plotshape(shorty, location=location.belowbar, color=color.red, style=shape.arrowdown, text="Sell")
plotshape(shortexity, location=location.bottom, color=color.red, style=shape.xcross, text="Sell exit")


//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
// STEP 1:
// Make input options that configure backtest date range
startDate = input.int(title="Start Date", defval=1, minval=1, maxval=31)
startMonth = input.int(title="Start Month", 
     defval=1, minval=1, maxval=12)
startYear = input.int(title="Start Year",
     defval=2021, minval=1800, maxval=2100)

endDate = input.int(title="End Date",
     defval=1, minval=1, maxval=31)
endMonth = input.int(title="End Month",
     defval=2, minval=1, maxval=12)
endYear = input.int(title="End Year",
     defval=2021, minval=1800, maxval=2100)

// STEP 2:
// Look if the close time of the current bar
// falls inside the date range
inDateRange =  true



// STEP 3:
// Submit entry orders, but only when bar is inside date range
if (inDateRange and longy)
    strategy.entry("enter long",strategy.long,when= longy)
    strategy.close("long",when=longexity)


if (inDateRange and shorty)
    strategy.entry("enter short",strategy.short,when = shorty)
    strategy.close("short", when=shortexity)


더 많은