SMA-RSI-MACD マルチインジケーターの組み合わせによる動的制限価格取引戦略

SMA RSI MACD EMA
作成日: 2024-12-11 15:15:49 最終変更日: 2024-12-11 15:15:49
コピー: 2 クリック数: 435
1
フォロー
1617
フォロワー

SMA-RSI-MACD マルチインジケーターの組み合わせによる動的制限価格取引戦略

概要

この戦略は,複数の技術指標を組み合わせた取引システムであり,主にEMA平均線交差,RSI超売り,MACD金叉三重信号の確認に基づいてポジションを開設し,ダイナミックな制限価格単入場と複数の退出メカニズムでリスクを管理する. 9サイクルと21サイクルインデクシアル移動平均 ((EMA) を主要なトレンドインデクシアルとして採用し,比較的強いインデクシアル ((RSI)) と移動平均のトレンドをインデクシアル ((MACD)) に逆行してフィルターする. 制限価格単距離と固定ストップ・ロスの数値を設定してリスクを制御する.

戦略原則

戦略の核心となる取引論理には以下の重要な部分が含まれています.

  1. 入場信号は9周期EMAに基づいて21周期EMAを穿越したときにトリガーされる.
  2. エントリー価格設定 9サイクルEMAの下の指定ポイント数値の制限価格リスト
  3. 取引確認は,設定値より低いRSIとMACD金叉を同時に満たす必要があります.
  4. 出場シグナルには,MACDデッドフォーク,固定ストップストープ損失点数,閉店強制平仓が含まれています.
  5. 取引時間は午前9時30分以降から午後3時10分まで制限されています.

策略は,限られた価格単一の入場方式を採用し,より良い価格位置にポジションを構築し,複数の技術指標の配合によって取引の正確性を向上させることができる.

戦略的優位性

  1. 多重シグナル認証メカニズムにより取引の信頼性が向上
  2. 限られたチケットで,よりよい取引価格を得ることができます.
  3. 固定ストップ・ストラスト・ポイントはリスク管理に役立ちます.
  4. 強制的な平仓の終了は,夜間のリスクを回避する
  5. 取引時間制限により,開場波動を回避
  6. EMAの指標はトレンドに反応する
  7. RSIとMACDの組み合わせは,偽の信号をフィルターすることができます

戦略リスク

  1. 複数のシグナルの確認により,一部の取引機会を逃す可能性があります.
  2. 価格が急上昇したため,限られた価格の商品は売れなかったかもしれない.
  3. 固定ポイントストップは,波動期に大きな損失を伴う可能性があります.
  4. MACDの信号が遅れている可能性
  5. 戦略は市場変動の影響を考慮していない
  6. パラメータ最適化には過度に適合するリスクがある

戦略最適化の方向性

  1. 市場波動に合わせて動的に調整される自己適応のストップ・ストップポイントを導入する
  2. 取引量指標の増強は,補足的な確認信号として
  3. トレンド強度フィルターを追加する
  4. ATRの動的調整を使用することを考慮して,限値単行距離の計算方法を最適化
  5. 市場情緒指標を追加して不利な市場環境をフィルターする
  6. ポジション管理メカニズムへの加入,信号の強度に応じて開庫量を調整

要約する

これは,構造が整った,論理が明確な多指標取引戦略であり,均線システムによってトレンドを識別し,RSIとMACDのフィルター信号,限価格注文と多重のストップ・メカニズムによってリスクを制御する. この戦略の優点は,信号の信頼性が高く,リスク管理が完璧であることであるが,信号の遅れやパラメータの最適化などの問題もある. ダイナミックなパラメータの調整と補助指標の追加を導入することによって,戦略には大きな最適化余地がある. 安定した投資家にトレンドが明瞭な市場環境で使用するのに適している.

ストラテジーソースコード
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("SMA 9 & 21 with RSI and MACD Buy Strategy", overlay=true)

// Inputs for Simple Moving Averages
sma_short = ta.ema(close, 9)
sma_long = ta.ema(close, 21)

// Plotting SMA
plot(sma_short, color=color.green, title="SMA 9")
plot(sma_long, color=color.red, title="SMA 21")

// RSI Calculation
rsi_length = input.int(14, title="RSI Length")
rsi_threshold = input.int(70, title="RSI Threshold")
rsi = ta.rsi(close, rsi_length)

// MACD Calculation
macd_fast = input.int(8, title="MACD Fast Length")
macd_slow = input.int(18, title="MACD Slow Length")
macd_signal = input.int(6, title="MACD Signal Length")
[macd_line, signal_line, _] = ta.macd(close, macd_fast, macd_slow, macd_signal)

// Inputs for Limit Order Offset
limit_offset = input.int(50, title="Limit Order Offset", minval=1)  // 50 points below 9 EMA

// User input for specific date
simulationStartDate = input(timestamp("2024-12-01 00:00"), title="Simulation Start Date", group = "Simulation Dates")
simulationEndDate = input(timestamp("2024-12-30 00:00"), title="Simulation End Date", group = "Simulation Dates")

// Declare limit_price as float
var float limit_price = na

// Calculate Limit Order Price
if (sma_short[1] < sma_long[1] and sma_short > sma_long)  // 9 EMA crosses above 21 EMA
    limit_price := sma_short - limit_offset

// Buy Signal Condition (only on the specified date)
buy_condition = not na(limit_price) and rsi < rsi_threshold and ta.crossover(macd_line, signal_line) 

// Sell Signal Condition (MACD crossover down)
sell_condition = ta.crossunder(macd_line, signal_line)

// Track Entry Price for Point-Based Exit
var float entry_price = na

if (buy_condition )
    strategy.order("Buy", strategy.long, comment="Limit Order at 9 EMA - Offset", limit=limit_price)
    label.new(bar_index, limit_price, "Limit Buy", style=label.style_label_up, color=color.green, textcolor=color.white)
    entry_price := limit_price  // Set entry price

// Exit Conditions
exit_by_macd = sell_condition
exit_by_points = not na(entry_price) and ((close >= entry_price + 12) or (close <= entry_price - 12))  // Adjust as per exit points

// Exit all positions at the end of the day
if hour == 15 and minute > 10 and strategy.position_size > 0
    strategy.close_all()  // Close all positions at the end of the day
    strategy.cancel_all()  

// Exit based on sell signal or point movement
if (exit_by_macd or exit_by_points  and strategy.position_size > 0 )
    strategy.close("Buy")
    label.new(bar_index, close, "Close", style=label.style_label_down, color=color.red, textcolor=color.white)