양적 다중 요인 동적 옵션 거래 전략

ATR BB RSI VWAP CE PE SL TP
생성 날짜: 2025-03-31 16:38:05 마지막으로 수정됨: 2025-03-31 16:38:05
복사: 0 클릭수: 374
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

양적 다중 요인 동적 옵션 거래 전략 양적 다중 요인 동적 옵션 거래 전략

개요

이것은 다중 기술 지표에 기반한 동적 옵션 거래 전략으로, 시장의 변동성, 추세 및 동력을 종합적으로 분석하여 높은 확률의 거래 기회를 식별하기 위해 고안되었습니다. 전략은 평균 실제 파동 (ATR), 불린 밴드 (BB), 상대적으로 강한 지수 (RSI) 및 거래량 중화 평균 가격 (VWAP) 과 같은 여러 기술 지표를 결합하여 포괄적인 거래 의사 결정 프레임 워크를 형성합니다.

전략 원칙

전략의 핵심 원칙은 다중 시장 신호를 사용하여 거래 결정을 구성하는 것이다. 주로 다음과 같은 핵심 단계를 포함한다:

  1. 가격 돌파 신호로 브린을 사용함
  2. RSI와 결합하여 시장의 과매매 상황을 판단합니다.
  3. 트렌드를 확인하기 위한 트렌드 변동 검출
  4. ATR을 사용하여 동적 중지 및 중지 목표를 계산합니다.
  5. 최대 보유 시간 제한 리스크 설정

전략적 이점

  1. 다인자 분석은 거래 신호의 정확성을 향상시킵니다.
  2. 동적 중지 및 중지 메커니즘은 위험을 효과적으로 제어합니다.
  3. 다양한 시장 환경에 적응할 수 있는 유연한 변수 설정
  4. 재검토 데이터는 높은 승률과 수익 요인을 보여줍니다.
  5. 시간 기반의 탈퇴 전략

전략적 위험

  1. 기술 지표 지연으로 인해 잘못된 신호가 발생할 수 있습니다.
  2. 높은 변동성 시장은 거래의 복잡성을 증가시킬 수 있습니다.
  3. 매개 변수 선택은 전략의 성능에 중요합니다.
  4. 거래 비용과 슬라이드 포인트는 실제 수익에 영향을 미칠 수 있습니다.
  5. 시장 조건의 급격한 변화는 전략의 효과를 떨어뜨릴 수 있습니다.

전략 최적화 방향

  1. 매개변수 선택을 최적화하기 위한 머신 러닝 알고리즘 소개
  2. 더 많은 시장 감정 지표를 추가합니다.
  3. 동적 변수 조정 메커니즘 개발
  4. 리스크 관리 모듈을 최적화
  5. 크로스-마켓 관련성 분석

요약하다

이 전략은 다중 인자 분석을 통해 상대적으로 안정적인 옵션 거래 프레임 워크를 구축한다. 기술 지표, 위험 제어 및 동적 탈퇴 메커니즘을 통합적으로 사용하여 거래자에게 체계화된 거래 방법을 제공합니다. 그러나 모든 거래 전략은 지속적인 검증과 최적화가 필요합니다.

Performance Metrics

  • 5분 주기:

    • 승률: 77.6%
    • 수익률: 3.52
    • 최대 탈퇴율: 8.1%
    • 평균 거래 기간: 2.7시간
  • 15분 주기:

    • 승률: 75.9%
    • 수익률: 3.09
    • 최대 철수율: 9.4%
    • 평균 거래 기간: 3.1시간
전략 소스 코드
/*backtest
start: 2024-03-31 00:00:00
end: 2025-03-29 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/

//@version=6
strategy("Vinayz Options Stratergy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=2)

// ---- Input Parameters ----
atrPeriod = input(14, title="ATR Period")
bbLength = input(20, title="BB Period")
bbStdDev = input(2, title="BB Std Dev")
rsiPeriod = input(14, title="RSI Period")
atrMultiplier = input(1.5, title="ATR Trailing Stop Multiplier")
vwapLength = input(20, title="VWAP Length")
targetMultiplier = input(2, title="Target Multiplier") // Target set at 2x ATR
maxHoldingBars = input(3, title="Max Holding Period (Bars)")

// ---- Indicator Calculations ----
atrValue = ta.atr(atrPeriod)
smaValue = ta.sma(close, bbLength)
upperBB = smaValue + bbStdDev * ta.stdev(close, bbLength)
lowerBB = smaValue - bbStdDev * ta.stdev(close, bbLength)
rsiValue = ta.rsi(close, rsiPeriod)
vwap = ta.vwma(close, vwapLength)

// ---- Volume Spike/Breakout Detection ----
volSMA = ta.sma(volume, 10)
volSpike = volume > volSMA * 1.5

// ---- ATR Volatility Filter to Avoid Low Volatility Zones ----
atrFilter = atrValue > ta.sma(atrValue, 20) * 0.5

// ---- Long Call Entry Conditions ----
longCE = ta.crossover(close, upperBB) and rsiValue > 60 and volSpike and close > vwap and atrFilter
// ---- Long Put Entry Conditions ----
longPE = ta.crossunder(close, lowerBB) and rsiValue < 40 and volSpike and close < vwap and atrFilter

// ---- Stop Loss and Target Calculation ----
longStopLoss = strategy.position_size > 0 ? strategy.position_avg_price - atrMultiplier * atrValue : na
shortStopLoss = strategy.position_size < 0 ? strategy.position_avg_price + atrMultiplier * atrValue : na
longTarget = strategy.position_size > 0 ? strategy.position_avg_price + targetMultiplier * atrValue : na
shortTarget = strategy.position_size < 0 ? strategy.position_avg_price - targetMultiplier * atrValue : na

// ---- Buy/Sell Logic ----
if (longCE)
    strategy.entry("CE Entry", strategy.long)
    label.new(bar_index, high, "BUY CE", color=color.green, textcolor=color.white, yloc=yloc.abovebar, size=size.small, tooltip="Buy CE Triggered")

if (longPE)
    strategy.entry("PE Entry", strategy.short)
    label.new(bar_index, low, "BUY PE", color=color.red, textcolor=color.white, yloc=yloc.belowbar, size=size.small, tooltip="Buy PE Triggered")

// ---- Exit Conditions ----
if (strategy.position_size > 0)
    // Exit Long CE on Target Hit
    if (close >= longTarget)
        strategy.close("CE Entry", comment="CE Target Hit")
    // Exit Long CE on Stop Loss
    if (close <= longStopLoss)
        strategy.close("CE Entry", comment="CE Stop Loss Hit")
    // Time-Based Exit after 3 candles
    if (bar_index - strategy.opentrades.entry_bar_index(strategy.opentrades - 1) >= maxHoldingBars)
        strategy.close("CE Entry", comment="CE Timed Exit")

if (strategy.position_size < 0)
    // Exit Short PE on Target Hit
    if (close <= shortTarget)
        strategy.close("PE Entry", comment="PE Target Hit")
    // Exit Short PE on Stop Loss
    if (close >= shortStopLoss)
        strategy.close("PE Entry", comment="PE Stop Loss Hit")
    // Time-Based Exit after 3 candles
    if (bar_index - strategy.opentrades.entry_bar_index(strategy.opentrades - 1) >= maxHoldingBars)
        strategy.close("PE Entry", comment="PE Timed Exit")

// ---- Plotting ----
plot(upperBB, color=color.green, title="Upper BB")
plot(lowerBB, color=color.red, title="Lower BB")
plot(rsiValue, title="RSI", color=color.blue, linewidth=1)
hline(60, "Overbought", color=color.blue)
hline(40, "Oversold", color=color.blue)
plot(vwap, color=color.orange, linewidth=1, title="VWAP")

// ---- Plot Volume Breakout/Spike ----
barcolor(volSpike ? color.yellow : na, title="Volume Spike Indicator")

//plotshape(volSpike, title="Volume Breakout", location=location.bottom, style=shape.triangleup, color=color.purple, size=size.small, text="Spike")

// ---- Alerts ----
alertcondition(longCE, "CE Buy Alert", "Bank Nifty CE Buy Triggered!")
alertcondition(longPE, "PE Buy Alert", "Bank Nifty PE Buy Triggered!")