
이 전략은 동적 지표 ((MACD, RSI) 와 거래량 필터를 결합한 트렌드 역전 거래 시스템이다. 범위를 필터 ((Range Filter) 를 도입하여 가격 변동에 대한 모니터링을 통해 시장의 꼭대기와 바닥에 대한 정확한 캡처를 구현한다. 이 전략은 전통적인 기술 지표에 기반한 거래량 확인 메커니즘을 추가하여 거래 신호의 신뢰성을 효과적으로 향상시킨다.
이 전략은 다중 지표 검증을 통한 거래입니다.
다중 조건의 동조동작은 다음과 같습니다:
위험 관리 제안:
이 전략은 여러 기술 지표의 협동적인 협동으로 비교적 완벽한 트렌드 역전 거래 시스템을 구축한다. 전략의 핵심 장점은 엄격한 신호 필터링 메커니즘과 유연한 변수 조정 공간에 있다. 전략은 지속적으로 최적화 및 개선함으로써 다양한 시장 환경에서 안정적인 성능을 유지할 것으로 예상된다. 실제 적용에서 투자자는 자신의 위험 선호도 및 시장 경험에 따라 전략 변수를 타겟 조정하는 것이 좋습니다.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("MACD & RSI with Range and Volume Filter", overlay=true)
// Inputs for MACD
fastLength = input.int(12, title="MACD Fast Length")
slowLength = input.int(26, title="MACD Slow Length")
signalLength = input.int(9, title="MACD Signal Length")
// Inputs for RSI
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(80, title="RSI Overbought Level")
rsiOversold = input.int(40, title="RSI Oversold Level")
// Inputs for Range Filter
rangePeriod = input.int(100, minval=1, title="Range Filter Period")
rangeMultiplier = input.float(3.0, minval=0.1, title="Range Filter Multiplier")
// Inputs for Volume Filter
volumeMA_Period = input.int(20, minval=1, title="Volume MA Period")
// MACD Calculation
[macdLine, signalLine, _] = ta.macd(close, fastLength, slowLength, signalLength)
// RSI Calculation
rsi = ta.rsi(close, rsiLength)
// Smooth Average Range
smoothRange(src, period, multiplier) =>
avgRange = ta.ema(math.abs(src - src[1]), period)
ta.ema(avgRange, period * 2 - 1) * multiplier
smoothedRange = smoothRange(close, rangePeriod, rangeMultiplier)
rangeFilter = ta.ema(close, rangePeriod)
upperBand = rangeFilter + smoothedRange
lowerBand = rangeFilter - smoothedRange
// Range Filter Conditions
priceAboveRange = close > upperBand
priceBelowRange = close < lowerBand
// Volume Filter
volumeMA = ta.sma(volume, volumeMA_Period)
highVolume = volume > volumeMA
// Buy and Sell Conditions with Range and Volume Filter
buyCondition = ta.crossover(macdLine, signalLine) and rsi < rsiOversold and priceBelowRange and highVolume
sellCondition = ta.crossunder(macdLine, signalLine) and rsi > rsiOverbought and priceAboveRange and highVolume
// Strategy Execution
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Alerts for Buy and Sell Signals
alertcondition(buyCondition, title="Buy Signal", message="Buy Signal Triggered")
alertcondition(sellCondition, title="Sell Signal", message="Sell Signal Triggered")
// Plot Buy and Sell Signals
plotshape(buyCondition, title="Buy Signal", text="Buy", style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0))
plotshape(sellCondition, title="Sell Signal", text="Sell", style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0))
// Plot Range Filter Bands
plot(upperBand, color=color.new(color.blue, 50), title="Upper Range Band")
plot(lowerBand, color=color.new(color.orange, 50), title="Lower Range Band")