デュアルタイムサイクルスーパートレンドとRSI戦略最適化システム

RSI ATR
作成日: 2024-11-25 17:27:21 最終変更日: 2024-11-25 17:27:21
コピー: 0 クリック数: 464
1
フォロー
1617
フォロワー

デュアルタイムサイクルスーパートレンドとRSI戦略最適化システム

概要

この戦略は,スーパートレンド指数とRSI指数に基づいた二時間周期の取引システムである.これは,120分と15分の2時間周期の技術分析指数と組み合わせ,スーパートレンド指数で中期トレンドの方向を捉え,RSI指数を利用して利益を得ることを目的としている.この戦略は,資金管理機構を採用し,ポジションをパーセントで割り当て,パーセントに基づいたストップ条件を設定している.

戦略原則

戦略の核心的な論理は以下の重要な要素に基づいています.

  1. 120分周期のスーパートレンド指標を主要トレンド判断ツールとして使用し,ATR周期14をベースに,因数設定は3.42
  2. 価格とスーパートレンドラインの交差によって取引シグナルが決定され,上向きの横断は多重シグナルを生じ,下向きの横断は空白シグナルを生じます
  3. 15分周期のRSI指標を補助ツールとして使用し,RSI周期は5で,市場の過熱または過冷却を判断します.
  4. RSIが超買区 (<95) に到達したときに多頭ポジションを平らげ,超売り区 () に到達したときに空頭ポジションを平らげ
  5. 平均開設価格に対して30%のパーセンテージストップポイントを設定します.

戦略的優位性

  1. 複数の時間周期を組み合わせることで,信号の信頼性が向上し,偽信号の影響を軽減する.
  2. SuperTrend指標のパラメータ最適化は,トレンドに対する感受性を保証するだけでなく,過度に感受性の原因となる頻繁な取引を避けるために適度である.
  3. RSIの極限設定は非常に厳格に設定されており,極端な状況でのみ平衡を触発し,早期脱出を避けるようにします.
  4. 資金管理は,口座の純資産の固定比率を35%で採用し,リスクを効果的に制御しながら,収益の余地を確保します.
  5. 新しいポジションを開く前に逆のポジションを自動でクリアし,同時に多空のポジションを保持するリスクを回避します.

戦略リスク

  1. 二重タイムサイクル戦略は,波動的な市場において後退効果を生じさせ,制御回収に注意する必要がある
  2. RSIの極限値が厳格に設定されすぎると,利益を得るチャンスを逃してしまう可能性があります.
  3. 30%のストップポイント設定は激進的なもので,波動的な市場では早期に利益を得ている可能性があります.
  4. ストップ・ロスの条件が設定されていない戦略で,突然トレンドが逆転すると,大きな損失を負う可能性があります.
  5. 35%のポジションは,市場が激しく波動する時にリスクが高いという比較的激進的な配比

戦略最適化の方向性

  1. 動的止損メカニズムを追加することを提案し,ATRベースの追跡止損を考慮することができます.
  2. RSIの超買超売の値が適切な緩和で10と90の調整を推奨し,戦略の適応性を高める
  3. 信号の信頼性を高めるために,補足確認として交差量指標を追加できます.
  4. ATRまたは波動率指数を使用して,市場の変動に応じてポジションの割合を動的に調整することを検討する
  5. DMIまたはADX指標のようなトレンド強度フィルターを追加し,弱トレンドの動きをフィルタリングすることをお勧めします.

要約する

これは,構造が整った,論理が明確なトレンド追跡戦略である.異なる時間周期の技術指標を組み合わせることで,トレンドを把握しながらもリスク管理にも注意する.いくつかの最適化可能なスペースがあるが,全体的な設計理念は,量化取引の基本原則に合致する.トレーダーは,現場で使用する前に,各項のパラメータを最適化して,自分のリスク承受能力に応じてポジション配合を調整することをお勧めする.

ストラテジーソースコード
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © felipemiransan

//@version=5
strategy("Supertrend Strategy", overlay=true)

// Function for Supertrend
supertrend(_factor, _atrPeriod) =>
    [out, _] = ta.supertrend(_factor, _atrPeriod)
    out

// Supertrend Settings
factor = input.float(3.42, title="Supertrend Factor")
atrPeriod = input.int(14, title="ATR Period")
tf2 = input.timeframe("120", title="Supertrend Timeframe")

// RSI Settings
rsi_tf = input.timeframe("15", title="RSI Timeframe")
rsiLength = input.int(5, title="RSI Length")
rsiUpper = input.int(95, title="RSI Upper Limit")  
rsiLower = input.int(5, title="RSI Lower Limit")   

// RSI Timeframe
rsi_tf_value = request.security(syminfo.tickerid, rsi_tf, ta.rsi(close, rsiLength), lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off)

// Supertrend Timeframe
supertrend_tf2 = request.security(syminfo.tickerid, tf2, supertrend(factor, atrPeriod), lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_off)

// Take Profit Settings (Percentage in relation to the average price)
takeProfitPercent = input.float(30, title="Take Profit", step=0.1) / 100

// Entry conditions based on price crossover with Supertrend Timeframe
longCondition = ta.crossover(close, supertrend_tf2) and barstate.isconfirmed
shortCondition = ta.crossunder(close, supertrend_tf2) and barstate.isconfirmed

// Execution of reversal orders with closing of previous position
if (longCondition)
    // Close a short position before opening a long position
    if (strategy.position_size < 0)
        strategy.close("Short", comment="Close Short for Long Entry")
    strategy.entry("Long", strategy.long)

if (shortCondition)
    // Close long position before opening short position
    if (strategy.position_size > 0)
        strategy.close("Long", comment="Close Long for Short Entry")
    strategy.entry("Short", strategy.short)

// Calculate take profit levels relative to the average entry price
if (strategy.position_size > 0)
    takeProfitLong = strategy.position_avg_price * (1 + takeProfitPercent)
    strategy.exit("Take Profit Long", "Long", limit=takeProfitLong)

if (strategy.position_size > 0 and (rsi_tf_value >= rsiUpper))
    strategy.close("Long", comment="RSI Take Profit Long")

if (strategy.position_size < 0)
    takeProfitShort = strategy.position_avg_price * (1 - takeProfitPercent)
    strategy.exit("Take Profit Short", "Short", limit=takeProfitShort)

if (strategy.position_size < 0 and (rsi_tf_value <= rsiLower))
    strategy.close("Short", comment="RSI Take Profit Short")

// Plot Supertrend timeframe with commit check to avoid repainting
plot(barstate.isconfirmed ? supertrend_tf2 : na, color=color.blue, title="Supertrend Timeframe (120 min)", linewidth=1)

// Plot RSI for visualization
plot(rsi_tf_value, "RSI", color=color.purple)
hline(rsiUpper, "RSI Upper", color=color.red)
hline(rsiLower, "RSI Lower", color=color.green)