イチモク・クラウドとRSIの組み合わせ戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-21 10:52:13
タグ:

概要

この戦略は,イチモク・クラウドと相対強度指数 (RSI) を組み合わせ,トレンド方向を決定し,トレンドが始まるとポジションを入力する.この戦略は,3つのイチモク線がRSI信号と有効な組み合わせで一致するときに取引信号を生成する.

戦略の論理

  1. イチモク雲のテンカンセン,キジョンセン,チコウスペンの線を計算する
  2. RSI値を計算する
  3. テンカンセンがキジュンセンに突入し,チコウ・スパンが雲に突入し,価格が雲に突入し,RSIが50を下回るとロング
  4. テンカン・センがキジョン・センを下回り,チコウ・スパンが雲を下回り,価格が雲を下回り,RSIが50を超えるとショートします
  5. 逆信号が表示されたとき 閉じる位置

具体的には,イチモク・クラウドのトレンド分析とRSIのオーバー・バイト・オーバー・セール・ゲージを組み合わせている. イチモク・ラインがトレンド開始形成に一致するとエントリーシグナルが生成され,RSIはオーバー・バイト・オーバー・セール状態を示さない. RSIフィルターは統合中に偽のブレイクを避けるのに役立ちます.出口は完全にイチモク・リバース・フォーメーションに従います.

利点分析

  1. RSIを組み合わせることで入力精度が向上します
  2. イチモク・クラウドは容量に強い傾向があります
  3. 信号はシンプルで直感的です
  4. カスタマイズ可能なパラメータは,異なるサイクルに適しています
  5. 停止利益/損失によるリスク管理

リスク分析

  1. イチモク雲が遅れて 偽のブレイクが発生する可能性があります
  2. パラメータの最適化が必要で,そうでなければ不正確な信号
  3. 長期保有は1日間のリスクをもたらす
  4. RSIは誤った信号に敏感です
  5. 逆転に囚われるリスク

リスクはパラメータの最適化,ストップ/損失調整,保有期間制限などによって管理できます.

オプティマイゼーションの方向性

  1. 最適な組み合わせのために異なる線とRSIパラメータをテストする
  2. トレイリングストップ・ロスを導入
  3. 取引時間制限を評価する
  4. 試験パラメータの好み
  5. 試験再入荷の追加とピラミッド式規則
  6. ストップ・プロフィット/損失戦略を比較する

概要

この戦略は,トレンド分析と取引のためにIchimoku CloudとRSIを組み合わせます.プロはシンプルな直感的な信号と高いROI;デメリットは遅延と罠にかかったリスクです. パラメータ最適化,ストップ/損失チューニング,取引時間制御などを通じてパフォーマンスを向上させ,リスクを制御することができます. イチモククラウドアプリケーションの包括的な理解を可能にします.


/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Coinrule

//@version=5
strategy("Ichimoku Cloud with RSI (By Coinrule)",
         overlay=true,
         initial_capital=1000,
         process_orders_on_close=true,
         default_qty_type=strategy.percent_of_equity,
         default_qty_value=30,
         commission_type=strategy.commission.percent,
         commission_value=0.1)

showDate = input(defval=true, title='Show Date Range')
timePeriod = time >= timestamp(syminfo.timezone, 2022, 6, 1, 0, 0)


// RSI inputs and calculations
lengthRSI = 14
RSI = ta.rsi(close, lengthRSI)


//Inputs
ts_bars = input.int(9, minval=1, title="Tenkan-Sen Bars")
ks_bars = input.int(26, minval=1, title="Kijun-Sen Bars")
ssb_bars = input.int(52, minval=1, title="Senkou-Span B Bars")
cs_offset = input.int(26, minval=1, title="Chikou-Span Offset")
ss_offset = input.int(26, minval=1, title="Senkou-Span Offset")
long_entry = input(true, title="Long Entry")
short_entry = input(true, title="Short Entry")

middle(len) => math.avg(ta.lowest(len), ta.highest(len))


// Components of Ichimoku Cloud
tenkan = middle(ts_bars)
kijun = middle(ks_bars)
senkouA = math.avg(tenkan, kijun)
senkouB = middle(ssb_bars)


// Plot Ichimoku Cloud
plot(tenkan, color=#0496ff, title="Tenkan-Sen")
plot(kijun, color=#991515, title="Kijun-Sen")
plot(close, offset=-cs_offset+1, color=#459915, title="Chikou-Span")
sa=plot(senkouA, offset=ss_offset-1, color=color.green, title="Senkou-Span A")
sb=plot(senkouB, offset=ss_offset-1, color=color.red, title="Senkou-Span B")
fill(sa, sb, color = senkouA > senkouB ? color.green : color.red, title="Cloud color")

ss_high = math.max(senkouA[ss_offset-1], senkouB[ss_offset-1])
ss_low = math.min(senkouA[ss_offset-1], senkouB[ss_offset-1])


// Entry/Exit Conditions
tk_cross_bull = tenkan > kijun
tk_cross_bear = tenkan < kijun
cs_cross_bull = ta.mom(close, cs_offset-1) > 0
cs_cross_bear = ta.mom(close, cs_offset-1) < 0
price_above_kumo = close > ss_high
price_below_kumo = close < ss_low

bullish = tk_cross_bull and cs_cross_bull and price_above_kumo
bearish = tk_cross_bear and cs_cross_bear and price_below_kumo

strategy.entry("Long", strategy.long, when=bullish and long_entry and RSI < 50 and timePeriod)
strategy.close("Long", when=bearish and not short_entry)

strategy.entry("Short", strategy.short, when=bearish and short_entry and RSI > 50 and timePeriod)
strategy.close("Short", when=bullish and not long_entry)

もっと