RSIを組み込んだ多時間枠ボリンガー帯のブレイクアウト戦略

作者: リン・ハーンチャオチャン,日付: 2024-02-21 13:59:31
タグ:

img

概要

この戦略は,ボリンジャーバンド,RSIインジケーター,およびマルチタイムフレーム分析を組み込み,中期から長期間のトレンドの方向性を把握する.低リスクエントリーのためのRSIオーバーバイト/オーバーセールシグナルと組み合わせたボリンジャーバンドのブレイクアウトを通じてトレンド逆転点を特定する.一方,より高いタイムフレームが適用され,市場をフィルタリングし,罠にはまらない.

戦略の論理

  1. 価格ブレイクを決定するためにボリンジャーバンドを適用する. 中央帯は,N日間の閉値の移動平均値である.上部と下部帯は,中部帯の両側で1標準偏差の距離に置かれています.上部帯の上を突破すると上昇傾向を示し,下部帯下を突破すると下落傾向を示します.

  2. 過剰購入/過剰販売レベルを特定するためにRSI指標を組み込む. RSIが70を超えると過剰購入状態を示し,30を下回ると過剰販売状態を示します. RSIが70を超えると上向きブレイクが上昇勢力の弱さを確認します. RSIが30を下回ると下向きブレイクが弱さを確認します.

  3. 偽のブレイクをフィルタリングするために,より高い時間枠を使用します. 日々の時間枠にブレイク信号が現れる場合,閉じ込められないようにするために,4時間またはそれ以上の時間枠からの追加の確認が必要です.

利点

  1. 複数の指標を統合することで 戦略の安定性と収益性が向上します

  2. RSIの含有は 偽のブレイクによる損失を軽減します

  3. 複数のタイムフレームの分析により 市場を効果的にフィルタリングし 罠にはまらないようにします

  4. breakout 信号の最適化決定 (連続3バーの breakout) は,エントリー前に十分なトレンド成熟度を確保する.

  5. 渦の指標は 初期段階から 新興傾向の方向性を決定します

リスク

  1. ボリンジャー・バンドのパラメータ化が不十分である場合,誤ったオーバー・バイト/オーバー・セールシグナルが生じる.

  2. 合理的なRSIパラメータ値は,異なる製品に対して別々に決定されなければならない.

  3. ブレイクシグナルが偽ブレイクシグナルであることが判明します.それに従ってストップロスを拡大することを検討してください.

  4. 十分なストップ損失率を維持する.例えば,ATRの3倍.

増進 の 機会

  1. 機械学習アルゴリズムを適用して ボリンジャー帯とRSIのパラメータを自動調整する.

  2. ストップ・ロスのレベルを最適化する 変動指標に基づいて

  3. ポジションサイズのモジュールを組み込み,市場の状況の変化に基づいてリスクを校正する.

  4. 資金管理の原則に基づいて,取引ごとに最大損失を制限する.

  5. 異なる取引セッションで信号の安定性を評価する.

結論

この戦略は,トレンド決定,過剰購入/過剰売却条件,複数のタイムフレームを包括的に検討し,リスクを制御し,魅力的なリスク・リターンプロファイルのための高品質の中長期トレンドを把握するための最適なエントリータイミングを探しています.さらに改善はパラメータ最適化,ストップ損失メカニズムなどを通じて探査され,さらに優れた投資パフォーマンスを達成することができます.


/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
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/
// © Noway0utstorm
//@version=5
strategy(title='Vortex0.71.3 + bb 3bar breakout + rsi - close hit upper or lower', shorttitle='truongphuthinh', format=format.price, precision=4,overlay = true)

length = input(20, title="Length")
mult = input(2.0, title="Multiplier")
source = close

basis = ta.sma(source, length)
dev = mult * ta.stdev(source, length)

upperBand = basis + dev
lowerBand = basis - dev

isClosedBar = ta.change(time("15"))

var bool closeAboveUpperBand = false
var bool closeBelowLowerBand = false


// Vortex Indicator Settings
period_ = input.int(14, title='Period', minval=2)

VMP = math.sum(math.abs(high - low[1]), period_)
VMM = math.sum(math.abs(low - high[1]), period_)
STR = math.sum(ta.atr(1), period_)
VIP = VMP / STR
VIM = VMM / STR

//
lengthrsi = input(14, title="RSI Length")
overboughtLevel = input(70, title="Overbought Level")
oversoldLevel = input(30, title="Oversold Level")

sourcersi = close
rsiValue = ta.rsi(sourcersi, lengthrsi)

shouldShort = rsiValue > overboughtLevel
shouldLong = rsiValue < oversoldLevel




if bool(isClosedBar[1]) and bool(isClosedBar[2]) and bool(isClosedBar[3])

    if close[1] > upperBand[1] and close[2] > upperBand[2] and close[3] > upperBand[3] and VIP > 1.25 and VIM < 0.7 and rsiValue > overboughtLevel
        strategy.entry("Short", strategy.short)
        closeAboveUpperBand := false  // Reset the condition when entering a new Short position
    if close[1] < lowerBand[1] and close[2] < lowerBand[2] and close[3] < lowerBand[3] and VIP < 0.7 and VIM > 1.25 and rsiValue < oversoldLevel
        strategy.entry("Long", strategy.long)
        closeBelowLowerBand := false  // Reset the condition when entering a new Long position



if strategy.position_size > 0  // Check if there is an open Long position
    closeAboveUpperBand := close > upperBand  // Update the condition based on close price
    if closeAboveUpperBand
        strategy.close("Long",disable_alert=true)  // Close the Long position if close price is above upper band

if strategy.position_size < 0  // Check if there is an open Short position
    closeBelowLowerBand := close < lowerBand  // Update the condition based on close price
    if closeBelowLowerBand
        strategy.close("Short",disable_alert=true)  // Close the Short position if close price is below lower band

// Plots
plot(basis, color=color.orange, title="Basis")
p1 = plot(upperBand, color=color.blue, title="Upper Band")
p2 = plot(lowerBand, color=color.blue, title="Lower Band")
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))

もっと