Bollinger + RSI ダブル戦略 (ロングのみ) v1.2

作者: リン・ハーンチャオチャン, 日付: 2023-12-08 10:39:52
タグ:

img

I. 戦略名

Bollinger Bands + RSI ダブル ロング ストラテジー

戦略の概要

この戦略は,ボリンジャーバンドス指標とRSI指標を組み合わせて,両方が過売り信号を示したときにロングをしたり,両方が過買い信号を示したときにロングを閉じる.単一の指標と比較して,取引信号をより信頼的に確認し,偽信号を避けることができます.

戦略の原則

  1. RSI インディケーターを使用して,買い過ぎ/売過ぎを判断する
    • RSI 50以下は過売りとみなされます.
    • RSI 50 を超えた値は過買いとみなされます.
  2. 価格極端を判断するためにボリンジャー帯を使用
    • 低価格帯下は過売れている
    • 上位帯以上の価格は過買いです
  3. RSIとボリンジャー・バンドの両方が過剰売り信号を示したときにロングに行く
    • RSI 50未満
    • 価格がボリンジャー下帯を下回る
  4. RSIとボリンジャー・バンドの両方が過買い信号を示すとき,ロングポジションを閉じる.
    • RSI 50以上
    • ボリンジャー上位帯の上の価格

IV 戦略の強み

  1. 2つの指標を組み合わせると,信号がより信頼性が高くなり,誤った信号は避けられます
  2. 論理を簡素化し,取引リスクを減らすのはロングポジションのみ

V. 戦略リスクと解決策

  1. 不適切なボリンジャー帯パラメータ設定,上下帯が幅が広い場合,不正取引リスクが増加します
    • ボリンジャー・バンドのパラメータを最適化し,合理的な期間と標準偏差を設定する
  2. RSI パラメータの設定が不適切で,誤った買い過ぎ/売り過ぎの基準は,誤った取引リスクを増やす
    • RSI パラメータを最適化し,RSI 期間を調整し,合理的な過買い/過売り基準を設定する
  3. 市場が動向していない場合の低収益性
    • トレンドインジケーターと組み合わせて,不安定な市場を避ける

戦略の最適化の方向性

  1. ボリンジャー帯とRSIパラメータの設定を最適化
  2. ストップ損失メカニズムを追加する
  3. MACD のような傾向指標と組み合わせる
  4. 短期分析と長期分析の組み合わせを追加する

VII.要約

この戦略は,ボリンジャーバンドとRSIインジケーターの強みを組み合わせ,両方が極端を示したときに取引する.これは単一のインジケーターからの偽信号を回避し,信号の精度を向上させる.以前のバージョンと比較して,ロングポジションのみを確立することで取引リスクが軽減される.将来の最適化はパラメータチューニング,ストップロスのメカニズム,トレンドインジケーターなどと組み合わせることで,戦略を異なる市場環境に適応できるようにすることができます.


/*backtest
start: 2023-11-30 00:00:00
end: 2023-12-07 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

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

// ChartArt's RSI + Bollinger Bands, Double Strategy UPDATE: Long-Only
//
// Version 1.2
// Idea by ChartArt on October 4, 2017.
//
// This strategy uses the RSI indicator 
// together with the Bollinger Bands 
// to buy when the price is below the
// lower Bollinger Band (and to close the
// long trade when this value is above
// the upper Bollinger band).
//
// This simple strategy only longs when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a oversold condition.
//
// In this new version 1.2 the strategy was
// simplified by going long-only, which made
// it more successful in backtesting. 
//
// List of my work: 
// https://www.tradingview.com/u/ChartArt/
// 
//  __             __  ___       __  ___ 
// /  ` |__|  /\  |__)  |   /\  |__)  |  
// \__, |  | /~~\ |  \  |  /~~\ |  \  |  
// 
// 


///////////// RSI
RSIlength = input(6,title="RSI Period Length") 
RSIoverSold = 50
RSIoverBought = 50
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(200, minval=1,title="Bollinger Period Length")
BBmult = 2 // 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=aqua,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=silver,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=silver,title="Bollinger Bands Lower Line")
fill(p1, p2)


///////////// Colors
switch1=input(true, title="Enable Bar Color?")
switch2=input(true, title="Enable Background Color?")
TrendColor = RSIoverBought and (price[1] > BBupper and price < BBupper) and BBbasis < BBbasis[1] ? red : RSIoverSold and (price[1] < BBlower and price > BBlower) and BBbasis > BBbasis[1] ? green : na
barcolor(switch1?TrendColor:na)
bgcolor(switch2?TrendColor:na,transp=50)


///////////// RSI + Bollinger Bands Strategy
long = (crossover(vrsi, RSIoverSold) and crossover(source, BBlower))
close_long = (crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper))

if (not na(vrsi))

    if long
        strategy.entry("RSI_BB", strategy.long, stop=BBlower, comment="RSI_BB")
    else
        strategy.cancel(id="RSI_BB")
        
    if close_long
        strategy.close("RSI_BB")


//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

もっと