개선된 추세 추종 모멘텀 돌파 추세 전략


생성 날짜: 2024-01-17 15:55:15 마지막으로 수정됨: 2024-01-17 15:55:15
복사: 1 클릭수: 1014
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

개선된 추세 추종 모멘텀 돌파 추세 전략

개요

이 글은 SuperTrend 지표와 Stochastic RSI 필터를 결합한 개선된 트렌드 추적 전략을 상세히 분석한다. 이 전략은 시장 추세를 고려하고 가짜 신호를 줄이는 동시에 구매 및 판매 신호를 생성하는 것을 목표로 한다.

전략 원칙

수퍼트렌드 계산

먼저, 실제 변동 범위 ((TR) 와 평균 실제 변동 범위 ((ATR) 를 계산한다. 그리고 ATR를 사용하여 상반 및 하반의 변동 범위를 계산한다:

상반기 = SMA ((폐쇄 가격, ATR 주기) + ATR 곱하기 × ATR 하위 궤도 = SMA ((폐쇄 가격, ATR 주기) - ATR 곱하기 ATR

만약 종결 가격이 하반기보다 높으면 상승 트렌드; 만약 종결 가격이 상반기보다 낮으면 하반기 트렌드. 상승 트렌드에서, SuperTrend은 하반기; 하향 트렌드에서, SuperTrend은 상반기 트렌드.

필터 메커니즘

가짜 신호를 줄이기 위해, SuperTrend을 이동 평균으로 처리하여 SuperTrend을 필터링합니다.

Stochastic RSI

RSI의 값을 계산하고, 스토카스틱 지표를 적용하면 스토카스틱 RSI를 생성한다. 이것은 RSI가 과매매 또는 과매매 영역에 있는지 여부를 나타냅니다.

출입 및 퇴출 조건

구매 조건: 종결 가격 상의 SuperTrend이 경계를 통과하고 상승 추세이며 Stochastic RSI < 80 판매 조건: 종결 가격 아래의 수퍼 트렌드, 하향 추세, 스토카스틱 RSI > 20

입출출: 마감 가격 아래에서 수퍼트렌드를 통과하고 상승 추세에 있습니다. 출구 판매: 종결 가격에서 상승한 슈퍼 트렌드 이후 하향 추세에 있다

전략적 이점

이것은 개선된 트렌드 추적 전략으로, 간단한 이동 평균과 같은 지표에 비해 다음과 같은 장점이 있습니다:

  1. 슈퍼트렌드 자체는 강력한 트렌드 인식 능력과 가짜 신호를 어내는 능력을 가지고 있습니다.
  2. 필터링 메커니즘을 적용하여 가짜 신호를 더 줄이고 신호를 더 신뢰할 수 있습니다.
  3. 스토카스틱 RSI는 과매매 시 발생하는 가짜 신호를 피하고, 전략이 중요한 지원 저항 지역 근처에서 신호를 발산하도록 합니다.
  4. 이 전략은 트렌드 방향과 Stochastic RSI의 오버 바이 오버 소드를 동시에 고려하여 트렌드를 추적하고 가짜 신호를 피하는 사이의 관계를 더 잘 균형을 잡습니다.
  5. 전략의 매개 변수는 다양한 시장 환경에 적용할 수 있습니다.

위험과 최적화

위험요소

  1. 시장의 급격한 변동 속에서, 정지 손실이 뚫릴 수 있습니다.
  2. 수퍼트렌드와 필터링 메커니즘은 모두 뒤쳐져 있으며, 최근 가격 변화를 놓칠 수 있습니다.
  3. Stochastic RSI 파라미터를 잘못 설정하는 것도 전략의 성과에 영향을 미칩니다.

위험 대응

  1. 적절히 조정된 중지 또는 위반 중지 사용.
  2. 매개 변수 ATR 주기, 필터 주기 등이 뒤떨어진 것을 균형을 맞추기 위해 조정된다.
  3. 스토카스틱 RSI의 매개 변수를 테스트하고 최적화한다.

최적화 방향

  1. 다양한 변수 조합을 테스트하여 최적의 변수를 찾습니다.
  2. 다른 필터링 메커니즘을 시도해 보세요.
  3. 응용 기계 학습 알고리즘 자동 최적화 매개 변수.
  4. 다른 지표와 함께 보완 입학에 따라

요약하다

이 전략은 SuperTrend와 Stochastic RSI 두 지표의 장점을 통합하여 트렌드를 효과적으로 식별하고 고품질의 거래 신호를 발산합니다. 또한 필터링 메커니즘은 시장의 소음에 대해 더 거칠게 만듭니다. 이 전략은 변수 최적화를 통해 더 나은 전략 효과를 얻을 수 있으며 다른 지표 또는 모델과 결합하는 것도 고려할 수 있습니다.

전략 소스 코드
/*backtest
start: 2024-01-09 00:00:00
end: 2024-01-16 00:00:00
period: 10m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Improved SuperTrend Strategy with Stochastic RSI", shorttitle="IST+StochRSI", overlay=true)

// Input parameters
atr_length = input(14, title="ATR Length")
atr_multiplier = input(1.5, title="ATR Multiplier")
filter_length = input(5, title="Filter Length")
stoch_length = input(14, title="Stochastic RSI Length")
smooth_k = input(3, title="Stochastic RSI %K Smoothing")

// Calculate True Range (TR) and Average True Range (ATR)
tr = ta.rma(ta.tr, atr_length)
atr = ta.rma(tr, atr_length)

// Calculate SuperTrend
upper_band = ta.sma(close, atr_length) + atr_multiplier * atr
lower_band = ta.sma(close, atr_length) - atr_multiplier * atr

is_uptrend = close > lower_band
is_downtrend = close < upper_band

super_trend = is_uptrend ? lower_band : na
super_trend := is_downtrend ? upper_band : super_trend

// Filter for reducing false signals
filtered_super_trend = ta.sma(super_trend, filter_length)

// Calculate Stochastic RSI
rsi_value = ta.rsi(close, stoch_length)
stoch_rsi = ta.sma(ta.stoch(rsi_value, rsi_value, rsi_value, stoch_length), smooth_k)

// Entry conditions
long_condition = ta.crossover(close, filtered_super_trend) and is_uptrend and stoch_rsi < 80
short_condition = ta.crossunder(close, filtered_super_trend) and is_downtrend and stoch_rsi > 20

// Exit conditions
exit_long_condition = ta.crossunder(close, filtered_super_trend) and is_uptrend
exit_short_condition = ta.crossover(close, filtered_super_trend) and is_downtrend

// Plot SuperTrend and filtered SuperTrend
plot(super_trend, color=color.orange, title="SuperTrend", linewidth=2)
plot(filtered_super_trend, color=color.blue, title="Filtered SuperTrend", linewidth=2)

// Plot Buy and Sell signals
plotshape(series=long_condition, title="Buy Signal", color=color.green, style=shape.triangleup, location=location.belowbar)
plotshape(series=short_condition, title="Sell Signal", color=color.red, style=shape.triangledown, location=location.abovebar)

// Output signals to the console for analysis
plotchar(long_condition, "Long Signal", "▲", location.belowbar, color=color.green, size=size.small)
plotchar(short_condition, "Short Signal", "▼", location.abovebar, color=color.red, size=size.small)

// Strategy entry and exit
strategy.entry("Long", strategy.long, when=long_condition)
strategy.entry("Short", strategy.short, when=short_condition)
strategy.close("Long", when=exit_long_condition)
strategy.close("Short", when=exit_short_condition)