
이 전략은 다중 기술 지표에 기반한 고주파 거래 시스템으로, 5분 시간 프레임에, 평행 시스템, 동적 지표, 거래량 분석을 결합한다. 이 전략은 동적으로 조정하는 방식으로 시장의 변동에 적응하고, 다중 신호 확인을 사용하여 거래의 정확성과 신뢰성을 향상시킨다. 전략의 핵심은 다차원 기술 지표의 조합을 통해 단기 시장 추세를 포착하는 데 있으며, 동적 스톱 로스를 사용하여 위험을 제어한다.
이 전략은 쌍평균선 시스템 ((9주기 및 21주기 EMA) 을 주요 트렌드 판단 도구로 사용하고 RSI 지표와 결합하여 동력을 확인한다. 가격이 쌍평균선 위에 있고 RSI가 40-65 영역에 있을 때, 시스템은 더 많은 기회를 찾는다. 가격이 쌍평균선 아래에 있고 RSI가 35-60 영역에 있을 때, 시스템은 빈 기회를 찾는다. 동시에, 전략은 거래량 확인 메커니즘을 도입하여 현재 거래량이 20주기 이동 평균 거래량보다 1.2배가 필요하다는 것을 요구한다. VWAP의 사용은 거래 방향과 주류 트렌드를 일일 유지하도록 추가로 보장한다.
이 전략은 여러 가지 기술 지표의 조합을 사용하여 비교적 완전한 거래 시스템을 구축한다. 전략의 장점은 다차원적인 신호 확인 메커니즘과 동적인 위험 제어 방법이다. 일부 잠재적인 위험이 있지만 합리적인 매개 변수 최적화 및 위험 관리를 통해 전략은 여전히 좋은 응용 가치가있다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Optimized Nifty MidCap Select Options 5-min Intraday Strategy", overlay=true)
// Parameters
emaShortPeriod = input.int(9, title="Short EMA")
emaLongPeriod = input.int(21, title="Long EMA")
rsiPeriod = input.int(14, title="RSI Period")
rsiOverbought = input.int(65, title="RSI Overbought Level") // More conservative than 70
rsiOversold = input.int(35, title="RSI Oversold Level") // More conservative than 30
atrLength = input.int(14, title="ATR Length")
atrMultiplier = input.float(1.5, title="ATR Multiplier")
volumeMultiplier = input.float(1.2, title="Volume Multiplier") // For confirming high-volume trades
// EMA Calculation
emaShort = ta.ema(close, emaShortPeriod)
emaLong = ta.ema(close, emaLongPeriod)
// RSI Calculation
rsiValue = ta.rsi(close, rsiPeriod)
// ATR Calculation
atrValue = ta.atr(atrLength)
// VWAP Calculation
vwapValue = ta.vwap(close)
// Volume Check
volumeCondition = volume > ta.sma(volume, 20) * volumeMultiplier
// Define long and short conditions
// Long Condition:
// Price above both EMAs, RSI not overbought, price above VWAP, and high volume
longCondition = (close > emaShort) and (close > emaLong) and (rsiValue > 40 and rsiValue < rsiOverbought) and (close > vwapValue) and volumeCondition
// Short Condition:
// Price below both EMAs, RSI not oversold, price below VWAP, and high volume
shortCondition = (close < emaShort) and (close < emaLong) and (rsiValue < 60 and rsiValue > rsiOversold) and (close < vwapValue) and volumeCondition
// Entry logic
if (longCondition)
strategy.entry("Buy Call", strategy.long)
if (shortCondition)
strategy.entry("Buy Put", strategy.short)
// Dynamic Take Profit and Stop Loss based on ATR
takeProfitLevel = strategy.position_avg_price * (1 + atrValue * atrMultiplier / 100)
stopLossLevel = strategy.position_avg_price * (1 - atrValue * atrMultiplier / 100)
// Exit strategy based on ATR levels
strategy.exit("Take Profit/Stop Loss", from_entry="Buy Call", limit=takeProfitLevel, stop=stopLossLevel)
strategy.exit("Take Profit/Stop Loss", from_entry="Buy Put", limit=takeProfitLevel, stop=stopLossLevel)
// Plotting indicators
plot(emaShort, title="9 EMA", color=color.blue)
plot(emaLong, title="21 EMA", color=color.red)
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
plot(vwapValue, title="VWAP", color=color.purple)