
이 전략은 여러 지표의 조화 트렌드 역전 거래 시스템으로, 주로 비교적 약한 지표 ((RSI), 패러폴리 라인 지표 ((SAR) 및 간단한 이동 평균 ((SMA) 의 세 가지 기술 지표를 결합한다. 전략의 핵심 아이디어는 RSI 초상도 신호를 통해 잠재적인 역전 기회를 경고하고, SAR 지표의 방향 변화를 사용하여 역전 신호를 확인하고, 마지막으로 이동 평균을 동적 스톱 손실 참조로 사용한다. 이 여러 지표의 조화 검증 방법은 가짜 신호의 간섭을 효과적으로 줄이고 거래의 신뢰성을 향상시킬 수 있다.
전략 운영 메커니즘은 크게 3단계로 구성됩니다.
이 전략은 RSI와 SAR의 협동 협력을 통해 비교적 신뢰할 수 있는 트렌드 역전 거래 시스템을 구축한다. 이동 평균을 동적 위험 관리 도구로 사용하여 트렌드를 효과적으로 파악하는 것은 물론 위험의 동적 통제를 실현한다. 전략의 주요 장점은 다중 신호 검증과 명확한 거래 규칙에 있다. 그러나 실제 응용에서는 시장 환경의 식별과 매개 변수의 동적 최적화에 주의를 기울여야 한다. 시장 환경 필터를 추가하고, 손실을 중지하는 방법을 최적화하고, 포지션 관리와 같은 방향을 개선함으로써 전략의 안정성과 수익성을 더욱 향상시킬 수 있다.
/*backtest
start: 2024-07-15 00:00:00
end: 2025-02-15 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BNB_USDT"}]
*/
//@version=5
strategy("SAR + RSI Strategy", overlay=true, margin_long=100, margin_short=100)
// ———————— SAR Parameters ————————
start = input(0.02, "SAR Start")
increment = input(0.02, "SAR Increment")
maximum = input(0.2, "SAR Maximum")
// ———————— RSI Parameters ————————
rsiLength = input(14, "RSI Length")
upperLevel = input(70, "RSI Upper Level")
lowerLevel = input(30, "RSI Lower Level")
// ———————— SMA Parameter ————————
smaLength = input(21, "SMA Exit Length")
// ———————— Indicators Calculation ————————
// SAR Calculation
sarValue = ta.sar(start, increment, maximum)
sarUp = sarValue < close
sarDown = sarValue > close
// RSI Calculation
rsi = ta.rsi(close, rsiLength)
rsiOverbought = ta.cross(rsi, upperLevel)
rsiOversold = ta.cross(rsi, lowerLevel)
// SMA Calculation
sma21 = ta.sma(close, smaLength)
// ———————— Entry Conditions ————————
longCondition =
// RSI oversold signal occurred in last 3 bars
(ta.barssince(rsiOversold) <= 3) and
// SAR reversal to bullish occurs now
sarUp and not sarUp[1]
shortCondition =
// RSI overbought signal occurred in last 3 bars
(ta.barssince(rsiOverbought) <= 3) and
// SAR reversal to bearish occurs now
sarDown and not sarDown[1]
// ———————— Exit Conditions ————————
exitLong = ta.crossunder(close, sma21)
exitShort = ta.crossover(close, sma21)
// ———————— Strategy Execution ————————
strategy.entry("Long", strategy.long, when=longCondition)
strategy.close("Long", when=exitLong)
strategy.entry("Short", strategy.short, when=shortCondition)
strategy.close("Short", when=exitShort)
// ———————— Visualizations ————————
// plot(sarValue, "SAR", style=plot.style_circles, color=sarUp ? color.green : color.red)
// plot(sma21, "21 SMA", color=color.orange)