
SPY RSI Stochastics의 교차 가치 역전 트렌드 전략은 RSI 지표의 빠른 선과 느린 선의 교차를 사용하여 가격 역전을 판단하는 양적 거래 전략이다. 이 전략은 느린 선, 빠른 선 및 MA 선을 결합하여 특정 조건에서 구매 및 판매 신호를 생성하여 큰 가격 역전 기회를 잡는다.
이 전략의 핵심 논리는 RSI 지표의 빠른 라인 교차에 기초한다. RSI는 일반적으로 과매도 과매도 영역에서 반전되기 때문에 빠른 RSI 라인과 느린 RSI 라인의 금포 및 사포 상황을 판단하여 가격을 반전 할 수있는 시간을 미리 판단 할 수 있습니다. 구체적으로, 전략은 다음과 같은 몇 가지 지표 및 조건에 주로 의존합니다.
빠른 RSI 라인이 느린 RSI 라인을 지나고 MA 라인을 지나면 구매 신호를 생성합니다. 빠른 RSI 라인이 느린 RSI 라인을 지나고 MA 라인을 지나면 판매 신호를 생성합니다.
또한, 일부 노이즈 트레이딩을 필터링하기 위해, 이 전략은 다음과 같은 논리를 설정합니다:
입학 후, 두 가지 탈퇴 조건이 있습니다:
SPY RSI Stochastics의 교차 가치 반전 트렌드 전략의 가장 큰 장점은 가격이 더 명백한 반전이 발생하기 전에 트렌드를 잡을 수 있다는 것입니다. 빠른 느린 RSI 라인을 교차하는 방식으로, 그것은 일정 시간 전에 거래 신호를 발송하여 입구 기회를 만들 수 있습니다. 또한, 이 전략은 다음과 같은 몇 가지 장점이 있습니다.
전체적으로, 이 전략은 트렌드 추적과 가치 반전의 판단을 결합하여 가격 반전의 시기를 어느 정도 파악할 수 있으며, 강력한 실용성을 가지고 있다.
SPY RSI Stochastics의 교차 변동 전략에는 장점이 있지만 다음과 같은 주요 위험도 있습니다.
위와 같은 위험들에 대해, 이 전략은 다음과 같은 측면에서 최적화되고 개선될 수 있습니다.
SPY RSI Stochastics의 교차 가치 역전 전략은 다음과 같은 몇 가지 측면에서 최적화 될 수 있습니다.
이러한 최적화는 전략의 매개 변수를 더 지능화하고 신호를 더 신뢰할 수 있게 만들 수 있으며, 또한 시장 변화에 따라 전략 규칙을 조정할 수 있어 전략의 안정적인 수익성을 크게 향상시킬 수 있다.
SPY RSI Stochastics의 교차 가치 반전 트렌드 전략은 RSI 느리고 빠른 선의 교차 상황을 판단하여 비교적 간단하고 명확한 양적 거래 전략을 설계했습니다. 그것은 트렌드 추적과 반전 거래의 특성을 결합하여 가격의 반전 시기를 어느 정도 파악 할 수 있습니다. 그러나이 전략에는 또한 고유 한 결함이 있습니다.
/*backtest
start: 2024-01-23 00:00:00
end: 2024-02-22 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("SPY Auto RSI Stochastics", pyramiding = 3)
// Input parameters
slowRSILength = input(64, title="SLOW RSI Length")
fastRSILength = input(9, title="FAST RSI Length")
smaRSILength = input(3, title="RSI SMA Length")
RSIUpperThreshold = input(83, title="RSI Upper")
RSILowerThreshold = input(25, title="RSI Lower")
RSIUpperDeadzone = input(61, title='RSI Upper Deadzone')
RSILowerDeadzone = input(39, title='RSI Lower Deadzone')
blockedDays = (dayofweek(time) == 1 or dayofweek(time) == 7)
sessionMarket = input("0900-0900", title="Session Start")
allowedTimes() => time(timeframe = timeframe.period, session = sessionMarket, timezone = "GMT+1")
isvalidTradeTime =true
// RSI and ATR
slowRSI = ta.rsi(close, slowRSILength)
fastRSI = ta.rsi(close, fastRSILength)
smaRSI = ta.sma(fastRSI, smaRSILength)
rsi = fastRSI
// Entry condition
RSIUptrend() => ta.crossover(fastRSI, slowRSI) and ta.crossover(fastRSI, smaRSI)
RSIDowntrend() => ta.crossunder(fastRSI, slowRSI) and ta.crossunder(fastRSI, smaRSI)
isRSIDeadzone() =>
rsi < RSIUpperDeadzone and rsi > RSILowerDeadzone
isBullishEngulfing() =>
close > high[1]
isBearishEngulfing() =>
close < low[1]
// Declare variables
var float initialSLLong = na
var float initialTPLong = na
var float initialSLShort = na
var float initialTPShort = na
//var bool inATrade = false
entryConditionLong = RSIUptrend() and not isRSIDeadzone() and isvalidTradeTime
entryConditionShort = RSIDowntrend() and not isRSIDeadzone() and isvalidTradeTime
exitConditionLong = entryConditionShort or fastRSI > RSIUpperThreshold
exitConditionShort = entryConditionLong or fastRSI < RSILowerThreshold
if (entryConditionLong)
strategy.entry(id = "Long", direction = strategy.long, alert_message = 'LONG! beep boop, all aboard the long train')
if (entryConditionShort)
strategy.entry(id = "Short", direction = strategy.short, alert_message = 'Short! beep boop, all aboard the short train')
if (exitConditionLong)
strategy.exit("Long", from_entry="Long", limit=close, alert_message = 'Stop Long, halt halt, take the profits and runnn')
if (exitConditionShort)
strategy.exit("Short", from_entry="Short", limit=close, alert_message = 'Stop Short, halt halt, take the profits and runnn')
//plot(smaRSI, "RSI MA", color=color.red)
plot(slowRSI, "Slow RSI", color=color.green)
//plot(fastRSI, "Fast RSI", color=color.white)
plot(smaRSI, "SMA RSI", color=color.white)