逆の意味の突破戦略

作者: リン・ハーンチャオチャン開催日:2023年12月20日 14:48:57
タグ:

img

概要

リバース・ミーン・ブレークスルー・ストラテジー (Reverse Mean Breakthrough Strategy) は,多要素のトレンド逆転戦略である.移動平均,ボリンジャー・バンド,CCI,RSI,その他の技術指標を組み合わせて,過剰購入および過剰販売の領域から価格逆転の機会を把握する.この戦略には,現在のトレンドと以前のトレンドとの間の不一致性を検出するための定期的な分散分析も組み込まれ,誤ったブレークアウトを回避する.

戦略原則

この戦略の主な論理は,価格が過剰購入または過剰販売ゾーンから逆転するときに適切なショートまたはロングポジションを取ることです.特に,この戦略は,4つの側面から逆転機会を判断します.

  1. CCI インディケーターやモメント インディケーターは,オーバー・バイトまたはオーバー・セール状態を判断するために,ゴールデン・クロス・デッド・クロス信号を発します.

  2. RSIインジケーターは過買い・過売区間を判断します.過買い・過売区間が65を超え,過売区間が35を下回ります.

  3. ボリンジャー帯上下レールを使用して,価格が通常の範囲から逸脱するかどうかを判断します. 通常範囲に戻ると価格が逆転する可能性があります.

  4. 誤ったブレイクを追いかけるのを避けるために RSI インジケーターの規則的な分散を検出します.

上記の条件を満たすと 戦略は逆方向のエントリーを取ります リスクを制御するためにストップ損失を設定します

利点分析

この戦略の最大の利点は,比較的高い勝利率で逆転機会を決定するために複数の指標を組み合わせることです.特に:

  1. 複数の要素を使用することで信頼性が高まります.単一の指標だけに頼るのを避け,誤った判断を減らすことができます.

  2. トレンドの逆転は勝率が高い.これは比較的信頼性の高い取引方法です.

  3. 差異を検知することで 偽の突破を追いかけるのを避け システムリスクを減らすことができます

  4. ストップ損失メカニズムは リスクを制御します 可能な限り 単一のチケット損失を最小限に抑えることができます

リスク分析

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

  1. 逆転タイミングの判断の不正確さ.ストップ損失を誘発することができます.適切なストップ損失範囲を拡大します.

  2. ボリンジャー・バンドのパラメータが不適切に設定されれば 通常の価格動向は異常だと考えられます パラメータは市場の波動に対応する必要があります

  3. 取引の頻度を減らすためにCCIなど判断範囲を適切に拡大します.

  4. 長短の不均衡は 歴史的なデータと一致するかどうかを判断します

最適化

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

  1. 機械学習アルゴリズムを使用してパラメータを自動的に最適化します 人工的な経験的エラーを避けるのです

  2. シェールインデックス,アンピルチュードインデックスなどを増やして 過剰購入と過剰販売強度を決定します

  3. 逆転の信頼性を決定するために,取引量指標を追加します.例えば,取引量,オープン・インテレストなど.

  4. 市場情勢を測るために ブロックチェーンデータを組み込む 戦略の適応性を向上させる

  5. 市場変動に基づいて 適応性のあるストップ・ロスのメカニズムを導入する.

概要

逆平均突破戦略は,逆転取引を決定するために複数の指標を統合する.適切なリスク制御により,比較的高い勝利率を有する.この戦略は,さらなる最適化のための余地があり,実用的です.適切なパラメータチューニングにより,かなり理想的な結果が得られるはずです.


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

//@version=5
strategy(title='BroTheJo Strategy', shorttitle='BTJ INV', overlay=true)

// Input settings
stopLossInPips = input.int(10, minval=0, title='Stop Loss (in Pips)')
ccimomCross = input.string('CCI', 'Entry Signal Source', options=['CCI', 'Momentum'])
ccimomLength = input.int(10, minval=1, title='CCI/Momentum Length')
useDivergence = input.bool(false, title='Find Regular Bullish/Bearish Divergence')
rsiOverbought = input.int(65, minval=1, title='RSI Overbought Level')
rsiOversold = input.int(35, minval=1, title='RSI Oversold Level')
rsiLength = input.int(14, minval=1, title='RSI Length')
plotMeanReversion = input.bool(true, 'Plot Mean Reversion Bands on the chart')
emaPeriod = input(200, title='Lookback Period (EMA)')
bandMultiplier = input.float(1.6, title='Outer Bands Multiplier')

// CCI and Momentum calculation
momLength = ccimomCross == 'Momentum' ? ccimomLength : 10
mom = close - close[momLength]
cci = ta.cci(close, ccimomLength)
ccimomCrossUp = ccimomCross == 'Momentum' ? ta.cross(mom, 0) : ta.cross(cci, 0)
ccimomCrossDown = ccimomCross == 'Momentum' ? ta.cross(0, mom) : ta.cross(0, cci)

// RSI calculation
src = close
up = ta.rma(math.max(ta.change(src), 0), rsiLength)
down = ta.rma(-math.min(ta.change(src), 0), rsiLength)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
oversoldAgo = rsi[0] <= rsiOversold or rsi[1] <= rsiOversold or rsi[2] <= rsiOversold or rsi[3] <= rsiOversold
overboughtAgo = rsi[0] >= rsiOverbought or rsi[1] >= rsiOverbought or rsi[2] >= rsiOverbought or rsi[3] >= rsiOverbought

// Regular Divergence Conditions
bullishDivergenceCondition = rsi[0] > rsi[1] and rsi[1] < rsi[2]
bearishDivergenceCondition = rsi[0] < rsi[1] and rsi[1] > rsi[2]

// Mean Reversion Indicator
meanReversion = plotMeanReversion ? ta.ema(close, emaPeriod) : na
stdDev = plotMeanReversion ? ta.stdev(close, emaPeriod) : na
upperBand = plotMeanReversion ? meanReversion + stdDev * bandMultiplier : na
lowerBand = plotMeanReversion ? meanReversion - stdDev * bandMultiplier : na

// Entry Conditions
prevHigh = ta.highest(high, 1)
prevLow = ta.lowest(low, 1)
shortEntryCondition = ccimomCrossUp and oversoldAgo and (not useDivergence or bullishDivergenceCondition) and (prevHigh >= meanReversion) and (prevLow >= meanReversion)
longEntryCondition = ccimomCrossDown and overboughtAgo and (not useDivergence or bearishDivergenceCondition) and (prevHigh <= meanReversion) and (prevLow <= meanReversion)

// Plotting
oldShortEntryCondition = ccimomCrossUp and oversoldAgo and (not useDivergence or bullishDivergenceCondition)
oldLongEntryCondition = ccimomCrossDown and overboughtAgo and (not useDivergence or bearishDivergenceCondition)
plotshape(oldLongEntryCondition, title='BUY', style=shape.triangleup, text='B', location=location.belowbar, color=color.new(color.lime, 0), textcolor=color.new(color.white, 0), size=size.tiny)
plotshape(oldShortEntryCondition, title='SELL', style=shape.triangledown, text='S', location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny)

// Strategy logic
if (longEntryCondition)
    stopLoss = close - stopLossInPips
    strategy.entry("Buy", strategy.long)
    strategy.exit("exit", "Buy", stop=stopLoss)
if (shortEntryCondition)
    stopLoss = close + stopLossInPips
    strategy.entry("Sell", strategy.short)
    strategy.exit("exit", "Sell", stop=stopLoss)

// Close all open positions when outside of bands
closeAll = (high >= upperBand) or (low <= lowerBand)

if (closeAll)
    strategy.close_all("Take Profit/Cut Loss")

// Plotting
plot(upperBand, title='Upper Band', color=color.fuchsia, linewidth=1)
plot(meanReversion, title='Mean', color=color.gray, linewidth=1)
plot(lowerBand, title='Lower Band', color=color.blue, linewidth=1)


もっと