RSI와 결합된 William Alligator 다중 레벨 확인 거래 전략

RSI SMA 威廉鳄鱼指标 相对强弱指标 交叉确认
생성 날짜: 2025-08-19 12:00:45 마지막으로 수정됨: 2025-08-19 12:00:45
복사: 0 클릭수: 274
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

RSI와 결합된 William Alligator 다중 레벨 확인 거래 전략 RSI와 결합된 William Alligator 다중 레벨 확인 거래 전략

개요

이 전략은 윌리엄스 알리거어 지표 ((Williams Alligator) 와 상대적으로 강한 지표 ((RSI) 를 기반으로 한 다단계 확인 거래 시스템이며, 15분 시간 주기용으로 설계되었다. 이 전략은 가격과 알리거어 삼선 ((lips, teeth, jaws) 의 위치 관계를 판단하고 RSI 지표의 수치를 통해 거래 신호를 생성한다. 구매 신호는 네 가지 조건을 충족해야 한다.

전략 원칙

이 전략의 핵심 원칙은 윌리엄스키 지표와 RSI 지표의 통합적인 사용에 기초한다. 윌리엄스키 지표는 3개의 평행선을 구성한다: ?? 선 ((파란색, 13주기 SMA, 8주기 뒤떨어진), 이빨 선 ((붉은, 8주기 SMA, 5주기 뒤떨어진) 및 입술 선 ((녹색, 5주기 SMA, 3주기 뒤떨어진). 이 3개의 선의 배열 순서와 가격 교차는 시장의 경향의 방향과 강도를 나타낸다.

립 라인이 이빨 라인 위에 있고 이빨 라인이 양치 라인 위에 있을 때, 시장이 상승 추세에 있다는 것을 나타냅니다. 반대로, 립 라인이 이빨 라인 아래에 있고, 이빨 라인이 양치 라인 아래에 있을 때, 시장이 하향 추세에 있다는 것을 나타냅니다. 이 전략은 또한 RSI 지표와 결합하여 확인됩니다. RSI가 55시에서 더 많은 지원을 받고 45시에서 더 적은 지원을 받으면 거래 결정에 추가적인 확인 신호를 제공합니다.

전략 실행 과정에서, 시스템은 여러 가지 중단 조건을 모니터링합니다: 다중 상점 포지션의 경우, RSI가 50을 넘어섰을 때, 닫기 가격이 치아선 또는 립선에서 치아선으로 넘어갔을 때 중지됩니다. 공백 포지션의 경우, RSI가 50을 넘어섰을 때, 닫기 가격이 치아선 또는 립선에서 치아선으로 넘어갔을 때 중지됩니다.

전략적 이점

  1. 다중 인증 메커니즘이 전략은 4가지 조건이 동시에 충족되어야 입장이 가능하며, 가짜 신호를 효과적으로 줄이고 거래 품질을 향상시킵니다. 윌리엄 해커 지표의 3선 배열은 트렌드 방향을 확인하고, RSI의 값은 동력을 확인합니다.

  2. 명확한 입출장 규칙전략은 명확한 진입 신호와 출구 조건을 제공하며, 주관적인 판단을 줄이고 거래 과정을 더 규율적이고 규율적으로 만듭니다.

  3. 완벽한 위험 관리이 전략은 RSI 기반의 반전 신호, 가격과 치아의 관계의 변화, 그리고 입술과 치아의 위치 관계의 변화와 같은 여러 가지 중단 조건을 설정합니다. 이러한 다층적 위험 제어 메커니즘은 단편 거래의 최대 위험을 통제하는 데 도움이 됩니다.

  4. 시각적 피드백전략: 차트에서 구매 신호, 판매 신호, 중지 및 수익을 얻었다 끝을 표시하고, 테이블을 통해 실시간으로 각 조건의 충족 상태를 표시하여 거래 과정의 가시성을 크게 향상시킵니다.

  5. 매우 적응력이 좋다: 전략 파라미터가 기본적으로 설정되어 있지만, 모든 핵심 파라미터는 입력으로 조정할 수 있으며, 트레이더가 다른 시장 환경이나 개인 취향에 따라 최적화 할 수 있습니다.

전략적 위험

  1. 작은 시장의 흔한 거래시장의 소규모 변동이 있을 때, 가격은 종종 해파리를 통과할 수 있고, RSI는 또한 극한 근처에서 변동할 수 있으며, 이는 과도한 거래 신호와 거래 비용을 증가시키는 빈번한 출입으로 이어집니다. 해결책은 확인 조건을 추가하거나 관찰 시간을 연장하는 것입니다.

  2. 급격한 폭락의 위험: 시장의 갑작스러운 중요한 소식이 가격의 급격한 급격한 변동으로 인해 실제 거래 가격이 시동 신호의 가격과 큰 격차를 가질 수 있으며, 슬라이드 포인트 위험을 증가시킵니다. 중요한 데이터가 발표되기 전에 신중하게 사용하거나 이 전략을 일시 중지하는 것이 좋습니다.

  3. 수익 목표 보수적전략은 수익 목표를 2 최소 변동 단위로 설정합니다. 이것은 변동성이 큰 시장에서 너무 보수적이어서 추세를 충분히 파악할 수 없습니다. 시장 변동에 따라 수익 목표를 동적으로 조정하는 것을 고려할 수 있습니다.

  4. 지표 지연윌리엄스어 지표와 RSI는 모두 뒤쳐져 있습니다. 시장이 급격하게 변할 때 교차점을 적시에 잡을 수 없습니다. 다른 선도적 지표 또는 가격 행동 분석과 함께 보조 판단을 수행하는 것이 좋습니다.

  5. 매개변수 민감도전략적 성능은 파라미터 설정에 민감하며, 특히 RSI의 스레드값 설정에 민감하다. 다른 파라미터 조합은 다른 시장 환경에서 다르게 작동할 수 있으며, 역검사를 통해 최적의 파라미터 조합을 찾는 것이 필요합니다.

전략 최적화 방향

  1. 동적 RSI: 현재 전략은 고정된 RSI 값 ((55과 45) 을 사용하며, 시장의 변동률에 따라 이러한 값을 조정하는 것을 고려할 수 있습니다. 높은 변동률의 시장에서는 더 느슨한 값을 사용하며, 낮은 변동률의 시장에서는 더 엄격한 값을 사용하여 다른 시장 환경에 적응합니다.

  2. 트랜잭션 필터 추가: 거래량 확인, 변동률 필터 또는 트렌드 강도 지표를 도입하여, 흔들리는 시장의 약한 신호를 필터링하여, 트렌드가 명확할 때만 입문하여 승률을 높인다.

  3. 정지방지 전략을 최적화현재 고정 2 틱의 정지 전략은 너무 간단합니다. 동적 정지 전략을 적용하는 것을 고려할 수 있습니다.

  4. 시간 필터시간 필터 기능을 추가하고, 부적절한 위험을 줄이기 위해 유동성이 부족하거나 변동성이 비정상적인 시기를 피합니다.

  5. 자금 관리 최적화: 현재 전략은 고정된 자본 비율 ((100%) 을 사용하여 거래하고, 시장의 변동률이나 계좌의 순가치 변화에 따라 역동적으로 위치 크기를 조정하는 것을 고려할 수 있으며, 더 과학적인 자금 관리를 실현한다.

요약하다

RSI와 결합된 다단계 확인 거래 전략은 구조가 잘 짜여 있고, 논리가 명확한 거래 시스템으로, RSI의 동력 확인 기능과 William Salmon 지표의 트렌드 판단 능력을 통합하여, 다단계 거래 의사 결정 프레임워크를 구축한다. 이 전략의 주요 장점은 여러 가지 확인 장치와 완벽한 위험 통제에 있다. 그러나 또한 과도한 충격 시장 신호, 슬라이드 포인트 위험 및 수익 목표 보수 등의 도전에 직면한다.

동적으로 RSI 마이너스를 조정하고, 거래 필터를 추가하고, 정지 전략을 최적화하고, 시간 필터를 추가하고, 자금 관리를 개선하는 등의 방향의 최적화를 통해 이 전략은 안정성과 수익성을 더욱 향상시킬 것으로 예상된다. 전반적으로, 이것은 기술 지표에 대한 지식이 있고, 선물 시장에서 안정적인 수익을 얻고자 하는 거래자에게 적합한 실용적인 가치의 양적 거래 전략이다.

전략 소스 코드
/*backtest
start: 2024-08-19 00:00:00
end: 2025-08-18 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_OKX","currency":"ETH_USDT","balance":5000}]
*/

//@version=5
strategy("Natural Gas Alligator RSI Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// =====================================
// INPUTS
// =====================================
// Williams Alligator Settings (default)
jaw_length = input.int(13, title="Jaw Length", minval=1)
jaw_offset = input.int(8, title="Jaw Offset", minval=0)
teeth_length = input.int(8, title="Teeth Length", minval=1)
teeth_offset = input.int(5, title="Teeth Offset", minval=0)
lips_length = input.int(5, title="Lips Length", minval=1)
lips_offset = input.int(3, title="Lips Offset", minval=0)

// RSI Settings (default)
rsi_length = input.int(14, title="RSI Length", minval=1)

// Natural Gas tick size (typically 0.001)
tick_size = input.float(0.001, title="Tick Size", minval=0.0001, step=0.0001)

// =====================================
// INDICATORS
// =====================================
// Williams Alligator
jaw = ta.sma(hl2, jaw_length)[jaw_offset]
teeth = ta.sma(hl2, teeth_length)[teeth_offset]
lips = ta.sma(hl2, lips_length)[lips_offset]

// RSI
rsi = ta.rsi(close, rsi_length)

// =====================================
// PLOT INDICATORS
// =====================================
plot(jaw, "Alligator Jaw", color=color.blue, linewidth=2)
plot(teeth, "Alligator Teeth", color=color.red, linewidth=2)
plot(lips, "Alligator Lips", color=color.green, linewidth=2)

// RSI (plotted in separate pane)
hline(50, "RSI Mid Line", color=color.gray, linestyle=hline.style_dashed)
hline(55, "RSI Buy Level", color=color.green, linestyle=hline.style_dotted)
hline(45, "RSI Sell Level", color=color.red, linestyle=hline.style_dotted)
plot(rsi, "RSI", color=color.purple)

// =====================================
// STRATEGY CONDITIONS
// =====================================

// Buy Conditions
buy_condition_1 = close > lips
buy_condition_2 = lips > teeth
buy_condition_3 = teeth > jaw
buy_condition_4 = rsi > 55

buy_signal = buy_condition_1 and buy_condition_2 and buy_condition_3 and buy_condition_4

// Sell Conditions
sell_condition_1 = close < lips
sell_condition_2 = lips < teeth
sell_condition_3 = teeth < jaw
sell_condition_4 = rsi < 45

sell_signal = sell_condition_1 and sell_condition_2 and sell_condition_3 and sell_condition_4

// Stop Loss Conditions for Long Position
long_stop_condition_1 = rsi < 50
long_stop_condition_2 = ta.crossunder(close, teeth)
long_stop_condition_3 = lips < teeth

long_stop_loss = long_stop_condition_1 or long_stop_condition_2 or long_stop_condition_3

// Stop Loss Conditions for Short Position
short_stop_condition_1 = rsi > 50
short_stop_condition_2 = ta.crossover(close, teeth)
short_stop_condition_3 = lips > teeth

short_stop_loss = short_stop_condition_1 or short_stop_condition_2 or short_stop_condition_3

// =====================================
// STRATEGY EXECUTION
// =====================================

// Variables to track entry prices
var float long_entry_price = na
var float short_entry_price = na

// Long Entry
if buy_signal and strategy.position_size == 0
    strategy.entry("Long", strategy.long)
    long_entry_price := close
    alert("Buy Signal Generated", alert.freq_once_per_bar)

// Short Entry
if sell_signal and strategy.position_size == 0
    strategy.entry("Short", strategy.short)
    short_entry_price := close
    alert("Sell Signal Generated", alert.freq_once_per_bar)

// Long Exit Conditions
if strategy.position_size > 0
    // Take Profit: 2 ticks above entry
    long_take_profit = long_entry_price + (2 * tick_size)
    
    if close >= long_take_profit
        strategy.close("Long", comment="Take Profit")
        alert("Take Profit - Long Position Closed", alert.freq_once_per_bar)
        long_entry_price := na
    
    // Stop Loss
    if long_stop_loss
        strategy.close("Long", comment="Stop Loss")
        alert("Stop Loss - Long Position Closed", alert.freq_once_per_bar)
        long_entry_price := na

// Short Exit Conditions
if strategy.position_size < 0
    // Take Profit: 2 ticks below entry
    short_take_profit = short_entry_price - (2 * tick_size)
    
    if close <= short_take_profit
        strategy.close("Short", comment="Take Profit")
        alert("Take Profit - Short Position Closed", alert.freq_once_per_bar)
        short_entry_price := na
    
    // Stop Loss
    if short_stop_loss
        strategy.close("Short", comment="Stop Loss")
        alert("Stop Loss - Short Position Closed", alert.freq_once_per_bar)
        short_entry_price := na

// =====================================
// CHART LABELS AND ALERTS
// =====================================

// Buy Signal Label
if buy_signal and strategy.position_size == 0
    label.new(bar_index, low - (high - low) * 0.1, "BUY\nSIGNAL", 
              color=color.green, style=label.style_label_up, 
              textcolor=color.white, size=size.small)

// Sell Signal Label
if sell_signal and strategy.position_size == 0
    label.new(bar_index, high + (high - low) * 0.1, "SELL\nSIGNAL", 
              color=color.red, style=label.style_label_down, 
              textcolor=color.white, size=size.small)

// Stop Loss Labels
if strategy.position_size > 0 and long_stop_loss
    label.new(bar_index, high + (high - low) * 0.1, "STOP\nLOSS", 
              color=color.orange, style=label.style_label_down, 
              textcolor=color.white, size=size.small)

if strategy.position_size < 0 and short_stop_loss
    label.new(bar_index, low - (high - low) * 0.1, "STOP\nLOSS", 
              color=color.orange, style=label.style_label_up, 
              textcolor=color.white, size=size.small)

// Take Profit Labels
if strategy.position_size > 0 and not na(long_entry_price) and close >= (long_entry_price + (2 * tick_size))
    label.new(bar_index, high + (high - low) * 0.1, "TAKE\nPROFIT", 
              color=color.blue, style=label.style_label_down, 
              textcolor=color.white, size=size.small)

if strategy.position_size < 0 and not na(short_entry_price) and close <= (short_entry_price - (2 * tick_size))
    label.new(bar_index, low - (high - low) * 0.1, "TAKE\nPROFIT", 
              color=color.blue, style=label.style_label_up, 
              textcolor=color.white, size=size.small)

// =====================================
// TABLE FOR CURRENT CONDITIONS
// =====================================
var table info_table = table.new(position.top_right, 2, 8, bgcolor=color.white, border_width=1)

if barstate.islast
    table.cell(info_table, 0, 0, "Condition", bgcolor=color.gray, text_color=color.white)
    table.cell(info_table, 1, 0, "Status", bgcolor=color.gray, text_color=color.white)
    
    table.cell(info_table, 0, 1, "Close > Lips", bgcolor=color.white)
    table.cell(info_table, 1, 1, buy_condition_1 ? "✓" : "✗", text_color=buy_condition_1 ? color.green : color.red)
    
    table.cell(info_table, 0, 2, "Lips > Teeth", bgcolor=color.white)
    table.cell(info_table, 1, 2, buy_condition_2 ? "✓" : "✗", text_color=buy_condition_2 ? color.green : color.red)
    
    table.cell(info_table, 0, 3, "Teeth > Jaw", bgcolor=color.white)
    table.cell(info_table, 1, 3, buy_condition_3 ? "✓" : "✗", text_color=buy_condition_3 ? color.green : color.red)
    
    table.cell(info_table, 0, 4, "RSI > 55", bgcolor=color.white)
    table.cell(info_table, 1, 4, buy_condition_4 ? "✓" : "✗", text_color=buy_condition_4 ? color.green : color.red)
    
    table.cell(info_table, 0, 5, "RSI < 45", bgcolor=color.white)
    table.cell(info_table, 1, 5, sell_condition_4 ? "✓" : "✗", text_color=sell_condition_4 ? color.red : color.green)
    
    table.cell(info_table, 0, 6, "Current RSI", bgcolor=color.white)
    table.cell(info_table, 1, 6, str.tostring(math.round(rsi, 2)), text_color=color.black)
    
    table.cell(info_table, 0, 7, "Position", bgcolor=color.white)
    position_text = strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "NONE"
    position_color = strategy.position_size > 0 ? color.green : strategy.position_size < 0 ? color.red : color.gray
    table.cell(info_table, 1, 7, position_text, text_color=position_color)