多指標ボリンジャーバンド取引戦略

作者: リン・ハーンチャオチャン開催日:2023年11月15日 15時30分43秒
タグ:

img

概要

この戦略は,ボリンジャーバンド,RSI,MACDなどの複数の技術指標を組み合わせて取引決定を下します.まず,グラフにボリンジャーバンドをプロットし,エントリー信号のためにバンドのブレイクアウトを使用します.RSIとMACDは,エントリーのための追加のフィルターとして使用されます.この戦略は,リスクを制御するためのバンドと指標に基づいてストップロスのルールを設定します.全体的には,複数の指標の強みを活用した包括的な戦略です.

戦略の論理

  1. 中央線,1stddevと2stddev帯を持つ34期ボリンジャー帯を描画する.

  2. 上部帯を超えると長引いて 下部帯を超えると短引いて

  3. 中央線を下回る近交差点では,長交差点を閉じる. 中央線を下回る近交差点では,短交差点を閉じる.

  4. RSI>70 を長値の追加確認として使用し,RSI<30 を短値の確認として使用します.

  5. RSIが50を超えるとショートポジションを閉じる RSIが50を超えるとロングポジションを閉じる

  6. MACDクロスオーバーをエントリの追加フィルターとして使用し,MACDクロスオーバーはロング,MACDクロスオーバーはショート.

  7. MACDクロスオーバーでロングポジションを閉じる MACDクロスオーバーでショートポジションを閉じる

  8. 3つのインディケーターが一致するように要求し,複数のフィルタが誤った信号を減らす.

利点

複数の指標からのシグナルを組み合わせることで,誤ったシグナルが減少し,収益性が向上する.ボリンジャー帯は価格ブレイクシグナルを提供し,RSIは過買い/過売れ地域を回避し,MACDはトレンド変化を捉える.

バンドとインジケーターに基づいた厳格なストップ・ロスのルールは,すべての取引で損失を制限します.これは,より高い収益性,勝利率,より低い最大引き下げをもたらします.

単一指標戦略と比較して,指標を組み合わせることでパフォーマンスが向上する.複数のフィルターは悪い信号を排除する.ストップ・ロスのメカニズムは損失の影響を制御する.

この戦略は,指標の詳細を使用して,大きな動きを捉えながら,ウィップソーを避ける.リスク制御により,より高いレバレッジを安全に使用できます.

リスク

主なリスクは:

  1. インディケーターからの誤った信号の可能性.パラメータを最適化することで誤った信号は減少するが排除できない.

  2. レンジ・バインド市場から利益を得ることができない.ストップ・ロスは統合中に損失を引き起こす可能性があります.ストップ・ロスのルールは,取引をより長く保持するために緩和することができます.

  3. 遅れている指標は 逃したエントリーチャンスにつながります より高度なリード指標は 早くターンを捕獲するのに役立ちます

  4. 価格のギャップを停止させ,ストップを停止させたり,平均を下げたりすることで,損失を制御することができます.

  5. 固定パラメータは,異なる市場のために調整を必要とする場合があります.機械学習は,パラメータの自動最適化を可能にします.

  6. 十分なテストが不足し,過剰なフィットメントが起こります. 戦略は,市場全体でより大きなデータセットでテストされ,信頼性が確保する必要があります.

増進 の 機会

戦略は,いくつかの方法で改善することができます:

  1. 誤った信号を最小限に抑える最良の組み合わせを見つけるために指標パラメータを最適化する. ブルートフォースまたは最適化方法を使用することができる.

  2. 固定の中間帯ストップの代わりに適応ストップ損失を組み込む.ストップはATR,トレンドなどに適応することができます.

  3. 変化する条件下での適応性パラメータ最適化のために機械学習を使用します.例えば強化学習です.

  4. トレンド検出ルールを追加し,異なる市場段階に異なる戦術を使用します.適応性を向上します.

  5. 感情やソーシャルメディアのデータを組み込み 多要素予測や主要指標を 強化します

  6. 指数関数的な成長のために,成長する口座サイズに基づいて,ポジションサイズをスケールするために複合を使用します.

  7. 不相関戦略との組み合わせを最適化し,多様化によってポートフォリオの変動を軽減する.

結論

この戦略は,強力なエントリーと出口信号のために複数の指標を組み合わせ,厳格なストップ損失規律を施行する.複数の指標を使用することで,誤った信号を軽減し,ストップは損失の大きさを制御する.安定したリターンを提供するトレンド市場にはうまく機能する.細かな調整パラメータと適応性を向上させることでパフォーマンスをさらに改善することができます.全体として,信頼性があり,安定し,効率的な取引システムです.


/*backtest
start: 2023-10-15 00:00:00
end: 2023-11-14 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
// Bollinger Bands: Madrid : 14/SEP/2014 11:07 : 2.0
// This displays the traditional Bollinger Bands, the difference is 
// that the 1st and 2nd StdDev are outlined with two colors and two
// different levels, one for each Standard Deviation

strategy(shorttitle='MBB', title='Bollinger Bands', overlay=true, currency=currency.NONE, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_value = 0.05)
src = input(close)
length = input.int(34, minval=1)
mult = input.float(2.0, minval=0.001, maxval=50)

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

upper1 = basis + dev
lower1 = basis - dev
upper2 = basis + dev2
lower2 = basis - dev2

colorBasis = src >= basis ? color.blue : color.orange

pBasis = plot(basis, linewidth=2, color=colorBasis)
pUpper1 = plot(upper1, color=color.new(color.blue, 0), style=plot.style_circles)
pUpper2 = plot(upper2, color=color.new(color.blue, 0))
pLower1 = plot(lower1, color=color.new(color.orange, 0), style=plot.style_circles)
pLower2 = plot(lower2, color=color.new(color.orange, 0))

fill(pBasis, pUpper2, color=color.new(color.blue, 80))
fill(pUpper1, pUpper2, color=color.new(color.blue, 80))
fill(pBasis, pLower2, color=color.new(color.orange, 80))
fill(pLower1, pLower2, color=color.new(color.orange, 80))


//Strategy code starts here

long_entry = ta.crossover(src, upper1)
short_entry = ta.crossunder(src, lower1)

strategy.entry("Long", strategy.long, when=long_entry)
strategy.entry("Short", strategy.short, when=short_entry)

if long_entry or close < basis
    strategy.close("Long", "Long") 

if short_entry or close > basis
    strategy.close("Short", "Short") 


//Calculate RSI
rsiLength = input(14)
rsiValue = ta.rsi(src, rsiLength)

// Define RSI conditions for entering and exiting trades
rsiLong = rsiValue > 70
rsiShort = rsiValue < 30


//Enter long position when RSI crosses above 50 and Bollinger Bands long entry condition is met
strategy.entry("Long", strategy.long, when=long_entry and rsiLong)

//Exit long position when RSI crosses below 50 or Bollinger Bands exit condition is met
strategy.close("Long Exit", when=rsiShort or close < basis)

//Enter short position when RSI crosses below 50 and Bollinger Bands short entry condition is met
strategy.entry("Short", strategy.short, when=short_entry and rsiShort)

//Exit short position when RSI crosses above 50 or Bollinger Bands exit condition is met
strategy.close("Short Exit", when=rsiLong or close > basis)



//Calculate MACD
fastLength = input(12)
slowLength = input(26)
macdLength = input(9)
macdValue = ta.macd(src, fastLength, slowLength, macdLength)

// Define MACD conditions for entering and exiting trades
macdLong = ta.crossover(src, macdLength)
macdShort = ta.crossunder(src, macdLength)

//Enter long position when MACD crosses above signal line and RSI and Bollinger Bands long entry condition is met
strategy.entry("Long", strategy.long, when=long_entry and rsiLong and macdLong)

//Exit long position when MACD crosses below signal line or RSI crosses below 50 or Bollinger Bands exit condition is met
strategy.close("Long Exit", when=macdShort or rsiShort or close < basis)

//Enter short position when MACD crosses below signal line and RSI crosses below 50 and Bollinger Bands short entry condition is met
strategy.entry("Short", strategy.short, when=short_entry and rsiShort and macdShort)

//Exit short position when MACD crosses above signal line or RSI crosses above 50 or Bollinger Bands exit condition is met
strategy.close("Short Exit", when=macdLong or rsiLong or close > basis)

もっと