ダブルシャドウパターン反転戦略


作成日: 2023-11-07 17:00:52 最終変更日: 2023-11-07 17:00:52
コピー: 1 クリック数: 664
1
フォロー
1617
フォロワー

ダブルシャドウパターン反転戦略

概要

双影形反転策は,K線形に基づく短線取引策である.この策は,連続した2つのK線が存在しない特殊なK線形を識別することによって,反転の可能性を判断する.この策の優点は,単純で容易に実現できるが,同時に一定のリスクがあることに注意する必要がある.

原則

この戦略の核心的な論理は,二重影形状の識別である.具体的には,戦略は,現在のK線が,開盘価格が最低価格,閉盘価格が最高価格の条件を満たしているかどうかを判断する.すなわち,下影線と上影線がなく,このK線はシャドーラインと呼ばれる.もし前K線もこの条件を満たしているならば,連続した2つのシャドーライン,すなわち二重影形状が生じたと考えられる.

テクニカル分析理論によれば,この二重影形は,通常,現在のトレンドの逆転が近づいていることを予告する.連続した2つのK線価格が,非常に狭い範囲内で波動するので,買い手と売り手の力がバランスを取っていることを示し,逆転の可能性を予告する.

二重シャドー形状を判定すると,戦略は,次のK線開盤時に,閉盘価格で多引または空引の方向に入ります. そして,設定されたバー数後に平仓で出場します.

利点

  • 戦略は明確でわかりやすく,形状はシンプルで,実行は簡単です.

  • クラシックな二重影の反転形を使って,ある程度の技術分析の根拠がある.

  • 取引コストとリスクを低減するために,操作頻度は低い.

  • フォローアップ機能が追加され,パラメータを最適化できます.

リスク

  • 形状取引は,歴史グラフの統計確率に依存し,完全には離散を避けることはできません.

  • 逆転を予知する双重影は,必ずしも逆転が起こることや維持されるわけではない.

  • 固定停止区間を設定することは,状況が迅速に動いている場合に対応するのが難しい.

  • “K線”や”K線”の情報を見れば,急進的な出場が起こりやすい.

思考を最適化する

  • 逆操作を避けるためにトレンド指数と組み合わせることができます.

  • 確認信号の返却を待つために, Wait for Confirm を入力してください.

  • ATRの動的な設定で停止することができます.

  • 機械学習により,どちらの二重影形がより信頼性があるかを判断できます.

要約する

二重影反転戦略は,古典的な形状取引理念を利用し,考え方はシンプルで直感的で,初心者の学習にも適しており,ロボットのモジュールの一つとしても使用できます.しかし,リスク管理には注意が必要であり,進場タイミングと停止方法を最適化することによって改善することができます.全体的に,この戦略の優劣は,参考に参考にできるほど明らかです.

ストラテジーソースコード
/*backtest
start: 2023-10-30 00:00:00
end: 2023-11-06 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("No Shadow Candles", overlay=true)

//set inputs
bars_until_close_trade = input(1,"Bars Until Close", minval = 1)
backtest_option = input(true,"Backtest on Twice alert?", bool)

//set conditions
up = close > close[1] and low >= open and high <= close
down = close < close[1] and low >= close and high <= open

up2 = (close > close[1] and low >= open and high <= close) and (close[1] > close[2] and low[1] >= open[1] and high[1] <= close[1])
down2 = (close < close[1] and low >= close and high <= open) and (close[1] < close[2] and low[1] >= close[1] and high[1] <= open[1])

close_trade = barssince(up or down) == bars_until_close_trade
close_trade2 = barssince(up2 or down2) == bars_until_close_trade

//plot indicators
plotshape(up,"Up Marker", shape.triangleup, location.belowbar, color = olive, size = size.tiny, transp = 50)
plotshape(down,"Down Marker", shape.triangledown, location.abovebar, color = orange, size = size.tiny, transp = 50)
plotshape(up2,"Up Twice Marker", shape.triangleup, location.belowbar, color = white, size = size.small)
plotshape(down2,"Down Twice Marker", shape.triangledown, location.abovebar, color = white, size = size.small)
plotshape(close_trade,"Close Trigger", shape.circle, location.belowbar, color = fuchsia, size = size.tiny, transp = 50)
plotshape(close_trade2,"Close Trigger2 (After Twice Alert)", shape.circle, location.belowbar, color = red, size = size.small)

//Strategy Testing


// Component Code Start
// Example usage:
// if testPeriod()
//   strategy.entry("LE", strategy.long)
testStartYear = input(2017, "Backtest Start Year")
testStartMonth = input(01, "Backtest Start Month")
testStartDay = input(2, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(2019, "Backtest Stop Year")
testStopMonth = input(7, "Backtest Stop Month")
testStopDay = input(30, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

// A switch to control background coloring of the test period
testPeriodBackground = input(title="Color Background?", type=bool, defval=true)
testPeriodBackgroundColor = testPeriodBackground and (time >= testPeriodStart) and (time <= testPeriodStop) ? #00FF00 : na
bgcolor(testPeriodBackgroundColor, transp=97)

testPeriod() => true
// Component Code Stop

//Entry and Close settings
if testPeriod() and backtest_option == true
    strategy.entry("up2", true, when = up2, limit = close)
    strategy.close("up2", when = close_trade)

if testPeriod() and backtest_option == false
    strategy.entry("up", true,  when = up, limit = close)
    strategy.close("up", when = close_trade)