二重確認逆転傾向追跡戦略

作者: リン・ハーンチャオチャン開催日:2024年1月17日 (月) 18:03:50
タグ:

img

概要

双重確認逆転傾向追跡戦略は123逆転パターン戦略とサポート/レジスタンスブレイクアウト戦略を統合し,価格逆転信号の双重確認を実現し,いくつかの騒々しい取引信号をフィルタリングすることで,戦略の勝利率を改善します.

価格が逆転信号を形成すると,キーサポートまたはレジスタンスレベルが同時に破綻しているかどうかを検出します.取引信号はダブル確認後に生成されます.

戦略原則

二重確認逆転傾向追跡戦略は2つの部分からなる.

  1. 123 逆転パターン戦略

    前回の2つのキャンドルスタイクの閉値を比較することで,価格が逆転パターンを形成しているかどうかを判断します. ストキャスト指標と組み合わせて,誤った機会をフィルタリングするために振動を決定します.

  2. サポート/レジスタンス ブレイク戦略

    前日の最高値,最低値,閉値を使用してサポートとレジスタンスのレベルを計算します.価格がこれらのキーレベルを突破するかどうかを監視します.

価格が両戦略の取引信号に同時に一致すると,逆転信号が2回確認され,最終的な取引命令が生成されると考えられます.

戦略 の 利点

  • 二重信号確認によりより高い信頼性
  • 逆転を追跡することで,ターンアロープの機会を間に合うように捉える
  • ストカスティック指標による効果的な偽のブレイクフィルタリング

戦略 の リスク

  • 双重確認によって少数の機会がフィルタリングされます
  • 主要な動向下での逆転の失敗リスク

パラメータは,二重確認の厳格性を調整し,勝利率と収益性の高い取引の数をバランスするために最適化できます.

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

  • 振動フィルタリングを最適化するためにストカスティックパラメータを調整する
  • サポート/レジスタンスレベルを計算するための異なるタイムフレームをテストする
  • 主要なトレンドの下での逆転リスクを減らすためにストップ損失戦略を追加する

結論

双重確認逆転トレンド追跡戦略は,逆転パターンとキーレベルブレイクアウトの利点を成功裏に組み合わせます.信号品質を改善しながら,取引の数も確保します.中長期トレンド取引に適した戦略です.パラメータチューニングとストップ損失戦略の追加により,戦略の安定性と実行性がさらに向上します.


/*backtest
start: 2023-12-17 00:00:00
end: 2024-01-16 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 15/09/2020
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// The name ‘Floor-Trader Pivot,’ came from the fact that Pivot points can 
// be calculated quickly, on the fly using price data from the previous day 
// as an input. Although time-frames of less than a day can be used, Pivots are 
// commonly plotted on the Daily Chart; using price data from the previous day’s 
// trading activity. 
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos


FPP() =>
    pos = 0
    xHigh  = security(syminfo.tickerid,"D", high[1])
    xLow   = security(syminfo.tickerid,"D", low[1])
    xClose = security(syminfo.tickerid,"D", close[1])
    vPP = (xHigh+xLow+xClose) / 3
    vR1 = (vPP * 2) - xLow
    vS1 = (vPP * 2) - xHigh
    pos := iff(close > vR1, 1,
             iff(close < vS1, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Floor Pivot Points", shorttitle="Combo", overlay = true)
Length = input(15, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posFPP = FPP()
pos = iff(posReversal123 == 1 and posFPP == 1 , 1,
	   iff(posReversal123 == -1 and posFPP == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1 , 1, pos))	   
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 )

もっと