
この戦略は,ウィリアムズ・アライガターと相対的に強い指標であるRSIをベースにした多層の確認取引システムで,15分間の周期に設計されている.この戦略は,価格とサメの三線 (唇,歯,) の位置関係とRSI指標の数値を判断することによって取引シグナルを生成する.購入シグナルには,4つの条件を満たす必要があります.
この戦略の核心原則は,ウィリアム・クジラ指数とRSI指数の総合的な使用に基づいています. ウィリアム・クジラ指数は,3つの均線で構成されています. クジラ線: ((青色,13周期SMA,遅滞8周期), 歯線: ((赤色,8周期SMA,遅滞5周期) と唇線: ((緑色,5周期SMA,遅滞3周期). この3つの線の並び順と価格の横断は,市場のトレンドの方向と強さを示すことができます.
唇線が歯線の上にあり,歯線が線の上にあり,市場が上昇傾向にあることを示し,逆に,唇線が歯線の下にあり,歯線が線の下にある場合は,市場が下降傾向にあることを示します. 同時に,この戦略は,RSI指標との組み合わせで確認されます.RSIは55時以上のサポートを多めにし,45時未満のサポートを空っぽにします.これは取引決定に追加の確認信号を提供します.
戦略の実行過程で,システムは複数のストップ条件を監視します.多頭ポジションの場合,RSIが50を下回り,閉じる価格が歯線または唇線が歯線を下回ったときにストップが誘発されます.空頭ポジションの場合,RSIが50を超え,閉じる価格が歯線または唇線が歯線を破ったときにストップが誘発されます.
複数の認証メカニズムこの戦略は,4つの条件を同時に満たして入場を許可し,偽信号を効果的に削減し,取引の質を向上させます. ウィリアム・クジラの指数の三線配列はトレンドの方向を確認し,RSIの値は動力を確認します.
明確な入場・出場ルール戦略は,明確な入場シグナルと出場条件を提供し,主観的な判断を減らし,取引プロセスをより規則的かつ規律的にします.
完璧なリスク管理戦略は,RSIに基づく反転信号,価格と歯線の関係の変化,および唇線と歯線の位置関係の変化を含む複数のストップ条件を設定します.この多層のリスク制御機構は,単一取引の最大リスクを制御するために,タイムリーにストップを助けるものです.
ビジュアルフィードバック戦略: グラフに買い信号,売り信号,ストップ・ロズ,利益の結末をマークし,各条件が満たされている状態を表でリアルタイムで表示することで,取引プロセスの可視性を大幅に高めます.
適応性が高い: 戦略パラメータはデフォルトで設定されていますが,すべての重要なパラメータは入力によって調整され,トレーダーは異なる市場環境または個人の好みに応じて最適化することができます.
わずかな波動の市場での頻繁な取引市場がわずかに揺れると,価格が頻繁に線を横断し,RSIが臨界点の近くで波動し,取引信号が過剰になり,取引コストが増加し,取引コストが増加する. 解決方法は,確認条件を追加するか,観察時間を延長することです.
市場が急激に急落するリスク: 市場の重大ニュースが急激に価格の大幅な波動を引き起こしたとき,実際の取引価格は,シグナルをトリガーした時の価格と大きな差があり,滑りやすいリスクが増加します.重要なデータの発表の前に慎重に使用するか,この戦略を一時停止することをお勧めします.
収益目標は保守的戦略は,利潤目標を2最小の変動単位に設定します.これは,波動が大きい市場では,過度に保守的で,トレンドの動きを十分に把握することができません.市場変動状況に応じて利潤目標の動的調整を考慮することができます.または,分量平仓戦略を採用することができます.
指標の遅れウィリアム・クジラ指数とRSIは,いずれも遅滞しており,市場が急速に変化するときに,ターニングポイントを間に合うように捉えることができない可能性があります. 他の主要指標または価格行動分析と組み合わせて補助判断を行うことをお勧めします.
パラメータ感度戦略性能はパラメータ設定,特にRSIの値設定に敏感である.異なるパラメータの組み合わせは,異なる市場環境で異なったパフォーマンスを発揮し,反射によって最適なパラメータの組み合わせを見つける必要があります.
RSIの動的下落について:現在の戦略は,固定RSI値 ((55と45) を使用し,市場の変動率の動向に応じてこれらの値の調整を考慮することができます. 高い変動の市場でより緩やかな値を使用し,低変動の市場でより厳しい値を使用し,異なる市場環境に対応します.
取引フィルターを追加する:取引量確認,波動率フィルター,またはトレンド強度指標を導入し,揺動する市場の弱い信号をフィルターし,トレンドが明確であるときにのみ入場し,勝利率を上げます.
を抑える戦略を最適化:現在の2チックの固定ストップ戦略は単純すぎます. ストップを追跡するストップやATR (平均リアル波動幅) に基づくストップなどのダイナミックストップ戦略を導入することを検討できます.
タイムフィルタータイムフィルター機能を追加し,不十分な流動性または変動の異常な時間,例えば開盤前後15分,または重要なデータの公開時間などを回避して,不必要なリスクを軽減します.
資金管理の最適化:現在の戦略は,固定資金比率 ((100%) を使って取引する.市場波動率や口座の純資産の変化に基づいてポジションサイズを動的に調整することを考えることができる.より科学的資金管理を実現する.
ウィリアム・クジラとRSIが結合した多層確認取引戦略は,構造が整った,論理が明確な取引システムであり,ウィリアム・クジラ指標のトレンド判断能力とRSIの動力確認機能を統合することにより,多層の取引意思決定枠組みを構築している.この戦略の主要な優点は,複数の確認機構と完善なリスク管理にあるが,震動市場の信号が多すぎ,滑り場リスク,利益目標保守などの課題に直面している.
この戦略は,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)