3倍BB帯はRSI戦略で突破する

作者: リン・ハーンチャオチャン,日付: 2024-02-29 14:57:49
タグ:

img

概要

この戦略は,ボリンジャーバンドとRSIインジケーターを組み合わせて取引信号を生成します. 3つのキャンドルスティックの閉値が同時に上位または下位帯を突破するかどうかを監視し,VortexインジケーターとRSIインジケーターを組み合わせて取引信号を確認します.

戦略原則

この戦略は主に以下の原則に基づいています.

  1. 取引シグナルを発行することを検討します. 価格が閉店時に上または下帯を突破すると,
  2. 偽のブレイクを避けるために同時に3つのキャンドルスタイクを突破する必要があります
  3. VIP>1.25,VIM>1.25,強烈な過剰購入時,Vortexインジケータを組み合わせ,シグナルをフィルタリングします.
  4. RSIが70を超えるとショート,RSIが30を超えるとロングを考える
  5. 上記条件を満たすとき,長信号と短信号が生成されます.

利点分析

この戦略の主な利点は以下の通りです.

  1. トリプルBB帯は偽のブレイクをフィルターし,ブレイクの信頼性を確保します
  2. Vortex インディケーターは市場の強さを判断し,市場での不利な取引を回避します.
  3. RSI インディケーターは,エントリーのためのボリンジャー・バンドインディケーターと組み合わせて,過剰購入および過剰販売領域を判断します.
  4. 複数の指標の組み合わせにより,市場情勢が包括的に判断され,信号の信頼性は比較的高い.

リスク分析

この戦略にはいくつかのリスクもあります:

  1. ボリンジャーバンド指標は,パラメータに非常に敏感で,長さとStdDev倍数最適化する必要があります
  2. サイクルのパラメータにも非常に敏感です. 異なる市場のために調整する必要があります.
  3. RSI インディケーターは分散傾向があり,トレンドを見逃すこともあります.
  4. 3つの指標の判断に意見が一致しない場合,参加は不可能で,いくつかの機会が失われます.

リスク管理対策には,以下が含まれます.

  1. パラメータを最適化し,バックテストで最も高い勝利率を持つパラメータを使用
  2. 取引量フィルタリングなどの他の指標を組み合わせる
  3. 良い機会を逃すのを防ぐために,適切な指標判断の論理を緩和する

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

戦略は以下の側面で最適化できます.

  1. 最適なパラメータを見つけるためにボリンジャーバンドの長さとStdDev倍数を最適化
  2. ワルテックス指標のサイクルを最適化し,異なる市場に適するよう
  3. 取引量,macd,などなどの他の指標の判断を増やし,分散された信号を豊かにします.
  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='RSI + BB  over 3 bar+--- vortex0.71.3  ', shorttitle='NoWaytruongphuthinh', 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))

もっと