双動平均クロスオーバーとブル・ベア・パワーバランスの組み合わせ戦略

作者: リン・ハーンチャオチャン開催日:2024-01-08 17:09:48
タグ:

img

概要

この戦略は,まず,市場への参入の基本基準として,価格が移動平均を突破するかどうかを決定するために,2期間のEMAと20期間のEMAの2つの移動平均線を使用する.同時に,補助指標"ブル・ベア・パワー・バランス・インディケーター"は,誤った操作を避けるためにブルとベア間の相対力をさらに特定する.この2種類の指標は共同で最終的な取引信号を生成する.

戦略原則

  1. 双動平均指数

    • 2 期間の指数関数移動平均 (EMA) と 20 期間の指数関数移動平均 (EMA) を計算する
    • 閉じる価格が移動平均値の片側からもう片方に突破したときの取引信号を生成する
    • 20-EMAを突破するとトレンド方向が決まる
    • 2-EMAを突破すると,特定のエントリーポイントが決定されます.
  2. ブール・ベア・パワー・バランス指標

    • 雄牛力値と熊力値を別々に計算する
    • 牛と熊の相対的な強さを決定するために2つの値を比較します
    • より強い指示は,入国のための補助的な判断として機能します
  3. この2つの指標を組み合わせた判断

    • 二重移動平均指標は主要なトレンド方向を判断します
    • ブル・ベア・パワー・バランス・インジケーターは 地元・地域を判断する
    • 両方の指標が一致する判断を出すとき,取引信号を発行する.

利点分析

この組み合わせ戦略の最大の利点は,より信頼性の高い取引判断を達成するために,さまざまな種類の指標を統合することです.特に,以下の利点があります.

  1. 主要な方向を決定するために二重移動平均を使用し,地元の変動に騙されないようにしてください.
  2. 特定のエントリーポイントを正確に把握するために,地元の地域判断のためのブルベアパワーバランス指標を使用
  3. 2種類の指標は互いに検証し,取引リスクを減らすためにいくつかの誤った操作をフィルタリングすることができます.
  4. 柔軟なパラメータ設定で,異なる市場種に最適化できます.
  5. 戦略のアイデアは シンプルで明快で 分かりやすく 後で最適化することも容易です

リスク分析

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

  1. インディケーター信号の遅延は,深いストップ損失点を超えることにつながります.
  2. 二重移動平均指標はパラメータ設定に敏感です
  3. ブール・ベアバランス指標は短期動向を判断する精度が少し低い.
  4. 特殊な市場条件下では,両方の指標に対して判断偏差が起こり得る (一般的な誤ったブレイクシグナル)

対策:

  1. 保持期間を適切に短縮するか,適切な移動ストップ損失を設定する
  2. 最適なパラメータを見つけるために異なるパラメータ組み合わせをテスト
  3. 確認のために他の指標を参照してください.
  4. 異なる品種の特徴に基づいてパラメータを最適化

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

この戦略は,次の側面においてさらに最適化することができる.

  1. 移動平均指標パラメータの組み合わせをテストする
  2. 単一のストップ損失を制御するためのストップ損失戦略を増やす
  3. パラメータの自己適応性を向上させるため,変動指標を組み込む
  4. ダイナミックパラメータ最適化を達成するために機械学習モデルを追加する
  5. トレンドをフォローする異なる指標を試し,牛熊のパワーバランスを置き換える
  6. 異なるパラメータのユーザーテストを容易にする視覚インターフェースを開発

結論

この戦略は,二重移動平均指標を通じて主要なトレンドを判断し,エントリータイミングを決定するのに役立つブルベアパワーバランス指標を使用します.この2つの指標は互いに検証し,誤った操作の確率を効果的に軽減することができます.戦略パラメータは柔軟で,さまざまな種類に最適化できます.全体として,戦略はシンプルで実践的です.ほとんどの投資家が学び,使用する価値があります.後の最適化は戦略のパフォーマンスをさらに改善することができます.


/*backtest
start: 2023-01-01 00:00:00
end: 2024-01-07 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 23/05/2022
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This indicator plots 2/20 exponential moving average. For the Mov 
// Avg X 2/20 Indicator, the EMA bar will be painted when the Alert criteria is met.
//
// Second strategy
//    This new indicator analyzes the balance between bullish and
//    bearish sentiment.
//    One can cay that it is an improved analogue of Elder Ray indicator.
//    To get more information please see "Bull And Bear Balance Indicator" 
//    by Vadim Gimelfarb. 
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
EMA20(Length) =>
    pos = 0.0
    xPrice = close
    xXA = ta.ema(xPrice, Length)
    nHH = math.max(high, high[1])
    nLL = math.min(low, low[1])
    nXS = nLL > xXA or nHH < xXA ? nLL : nHH
    iff_1 = nXS < close[1] ? 1 : nz(pos[1], 0)
    pos := nXS > close[1] ? -1 : iff_1
    pos


BBB(SellLevel,BuyLevel) =>
    pos = 0.0
    value = close < open ? 
              close[1] > open ?  math.max(close - open, high - low) : high - low : 
                 close > open ? 
                  close[1] > open ? math.max(close[1] - low, high - close) : math.max(open - low, high - close) :
                   high - close > close - low ? 
                     close[1] > open ? math.max(close[1] - open, high - low) :high - low : 
                      high - close < close - low ? 
                         close > open ? math.max(close - low, high - close) : open - low : 
                           close > open ? math.max(close[1] - open , high - close) :
                             close[1] < open ? math.max(open - low, high - close) : high - low
    
    value2 =close < open ? 
              close[1] < open ?  math.max(high - close[1], close - low) : math.max(high - open, close - low) : 
               close > open ? 
                 close[1] > open ?  high - low : math.max(open - close[1], high - low) : 
                  high - close > close - low ? 
                   close[1] < open ? math.max(high - close[1], close - low) : high - open : 
                     high - close < close - low ? 
                      close[1] > open ?  high - low : math.max(open - close, high - low) : 
                       close[1] > open ? math.max(high - open, close - low) :
                         close[1] < open? math.max(open - close, high - low): high - low
    nBBB = value2 - value
    pos :=  nBBB < SellLevel ? -1 :
    	     nBBB >= BuyLevel ? 1 : nz(pos[1], 0) 
    pos

strategy(title='Combo 2/20 EMA & Bull And Bear Balance', shorttitle='Combo', overlay=true)
var I1 = '●═════ 2/20 EMA ═════●'
Length = input.int(14, minval=1, group=I1)
var I2 = '●═════  Bull And Bear Balance ═════●'
SellLevel = input.float(-15, step=0.01, group=I2)
BuyLevel = input.float(15, step=0.01, group=I2)
var misc = '●═════ MISC ═════●'
reverse = input.bool(false, title='Trade reverse', group=misc)
var timePeriodHeader = '●═════ Time Start ═════●'
d = input.int(1, title='From Day', minval=1, maxval=31, group=timePeriodHeader)
m = input.int(1, title='From Month', minval=1, maxval=12, group=timePeriodHeader)
y = input.int(2005, title='From Year', minval=0, group=timePeriodHeader)
StartTrade = time > timestamp(y, m, d, 00, 00) ? true : false
posEMA20 = EMA20(Length)
prePosBBB = BBB(SellLevel,BuyLevel)
iff_1 = posEMA20 == -1 and prePosBBB == -1 and StartTrade ? -1 : 0
pos = posEMA20 == 1 and prePosBBB == 1 and StartTrade ? 1 : iff_1
iff_2 = reverse and pos == -1 ? 1 : pos
possig = reverse and pos == 1 ? -1 : iff_2
if possig == 1
    strategy.entry('Long', strategy.long)
if possig == -1
    strategy.entry('Short', strategy.short)
if possig == 0
    strategy.close_all()
barcolor(possig == -1 ? #b50404 : possig == 1 ? #079605 : #0536b3)

もっと