RSIとボリンジャー帯の二重戦略

作者: リン・ハーンチャオチャン,日付: 2024-04-03 17:54:52
タグ:RSIBBSMAstdev

img

概要

この戦略は,相対強度指数 (RSI) とボリンジャーバンドの技術指標を組み合わせます.価格がボリンジャーバンドの下位を下回ると購入信号を生成し,価格がボリンジャーバンド上位を超えると販売信号を生成します.この戦略は,RSIとボリンジャーバンドの両方の指標が同時に過売れまたは過買い状態にある場合にのみ取引信号を誘発します.

戦略の論理

  1. 設定されたRSIパラメータに基づいて RSI値を計算する.
  2. 中間,上部,下部のボリンジャー帯を計算するにはボリンジャー帯式を使用します.
  3. 現在の閉じる価格がボリンジャー帯の上位か下位を突破するかどうかを決定します.
  4. 現在のRSI値が過買い値を超えているか過売り値を下れているかを決定する.
  5. Bollinger Bands と RSI 指標の両方がそれぞれの条件を満たすときに,対応する買取または売却信号を生成する.

戦略 の 利点

  1. 市場状況のより包括的な評価のために,傾向と勢力の指標を組み合わせます.
  2. フィルターとして2つのインジケーターを使用すると,誤った信号の確率が効果的に減少します.
  3. 明確なコードロジックと柔軟なパラメータ設定で,異なる市場環境と取引スタイルに適しています.

戦略リスク

  1. 市場が不安定な場合 この戦略は損失を伴う取引を増やす可能性があります
  2. 不適切なパラメータ設定は,戦略の性能が低下し,実際の条件に基づいて最適化が必要になる可能性があります.
  3. この戦略にはストップ・ロスは含まれず,それにより,大きな引き上げリスクにさらされる可能性があります.

戦略の最適化方向

  1. RSIとボリンジャー帯のパラメータを市場特性と個人の好みに基づいて最適化する.
  2. 信号の信頼性を向上させるため,MACD,移動平均等などの追加的な技術指標を導入する.
  3. 単一の取引リスクを制御するために,合理的なストップ・ロースとテイク・プロフィートのレベルを設定する.
  4. 不安定な市場では,頻繁な取引に関連するコストを下げるため,より多くの条件を追加したり,ポジションサイズを減らすことを検討してください.

概要

RSIとボリンジャーバンドズ・ダブル戦略は,市場状況の比較的包括的な評価と対応する取引信号を生成するために,トレンドとモメント指標を組み合わせます.しかし,この戦略は不安定な市場では劣悪なパフォーマンスを発揮し,リスク管理措置が欠如しているため,ライブ取引に適用する際には注意が必要です.パラメータを最適化し,他の指標を導入し,合理的なストップ・ロストとテイク・プロフィートレベルを設定することで,この戦略の安定性と収益性がさらに向上することができます.


/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Bollinger + RSI, Double Strategy (by ChartArt) v1.1", shorttitle="CA_-_RSI_Bol_Strat_1.1", overlay=true)

// ChartArt's RSI + Bollinger Bands, Double Strategy - Update
//
// Version 1.1
// Idea by ChartArt on January 18, 2015.
//
// This strategy uses the RSI indicator 
// together with the Bollinger Bands 
// to sell when the price is above the
// upper Bollinger Band (and to buy when
// this value is below the lower band).
//
// This simple strategy only triggers when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a overbought or oversold condition.
//
// In this version 1.1 the strategy was
// both simplified for the user and
// made more successful in backtesting. 
//
// List of my work: 
// https://www.tradingview.com/u/ChartArt/
// 
//  __             __  ___       __  ___ 
// /  ` |__|  /\  |__)  |   /\  |__)  |  
// \__, |  | /~~\ |  \  |  /~~\ |  \  |  
// 
// 

///////////// RSI
RSIlength = input(14,title="RSI Period Length") 
RSIoverSold = 30
RSIoverBought = 70
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(20, minval=1,title="Bollinger Period Length")
BBmult = input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = crossover(source, BBlower)
sellEntry = crossunder(source, BBupper)
plot(BBbasis, color=color.blue,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=color.red,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=color.green,title="Bollinger Bands Lower Line")
fill(p1, p2)

// Entry conditions
crossover_rsi = crossover(vrsi, RSIoverSold) and crossover(source, BBlower)
crossunder_rsi = crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper)

///////////// RSI + Bollinger Bands Strategy
if (not na(vrsi))
    if (crossover_rsi)
        strategy.entry("RSI_BB_L", strategy.long, comment="RSI_BB_L")
    else
        strategy.cancel(id="RSI_BB_L")
        
    if (crossunder_rsi)
        strategy.entry("RSI_BB_S", strategy.short, comment="RSI_BB_S")
    else
        strategy.cancel(id="RSI_BB_S")


関連性

もっと