3本線パターン突破戦略


作成日: 2023-09-23 16:02:20 最終変更日: 2023-09-23 16:02:20
コピー: 2 クリック数: 622
1
フォロー
1617
フォロワー

概要

この策略は三線形表示法に基づく改良である.それは,閉じる価格で構成される2つの線が,雲形を形成する.多頭傾向にある時,価格が雲の底を突破すると,新しい空頭傾向が始まる.空頭傾向にある時,価格が雲の頂を突破すると,新しい多頭傾向が始まる.この策略は,純粋な価格行動策略であり,スーパートレンドなどの指標の組み合わせで使用できる.

戦略原則

  1. 現在の価格のxuを定義し,三線形を描くために使用されるxu1,xu2,xu3を定義する.

  2. 価格を三線形として描く上下限を判断する.更新:xu1,xu2,xu3。

  3. xuは,xu3を突破し,空頭から始め,xuは,xu1を突破し,多頭から始めます.

  4. 雲の形状を図に描く.

  5. ポジティブ取引と逆取引の選択肢があります.

  6. 雲を突破すると余分な空白を行い,雲の中に戻ると平仓する.

優位分析

この戦略の主な利点は:

  1. 外部指標に影響を受けない純価格行動に基づく

  2. 三線形は清晰で直感的で,操作を判断しやすい.

  3. 設定可能な反転取引は,下落の機会に適用されます.

  4. 傾向や他の指標の組み合わせで簡単に使用できます.

  5. 画像の解析と可視化が簡単で, 操作と最適化も簡単です

リスク分析

この戦略の主なリスクは

  1. 純価格行動は突発的な出来事の影響を受けやすいので,偽の突破が生じます.

  2. 止損設定がないため,損失の危険性が高くなります.

  3. 取引費用の影響は考慮されていません.

  4. パラメータは固定され,異なる品種の効果に違いがある可能性があります.

  5. 突破の連続は考慮されていない.

  6. 逆のトレンドでは注意が必要で,大きなトレンドに反する可能性があります.

最適化の方向

この戦略は以下の点で最適化できます.

  1. ストップ・ロズ戦略を設定し,ストップ・ロズポイントを最適化します.

  2. 取引費用の影響を考慮する

  3. 異なる品種のパラメータの効果をテストし,パラメータ最適化を確立する.

  4. 形状突破判断の論理を最適化して,連続突破を処理する.

  5. 増加とトレンド指標の組み合わせで逆転を避ける.

  6. ポジション数制御を追加する.

  7. テスト期間を延長し,安定性を確認する.

要約する

三線形突破戦略は直感的に操作しやすく,価格行動の判断に基づいて取引信号を生成する.トレンドと他の指標を組み合わせて戦略の効果を高めることができる. 止損,最適化パラメータと論理,ポジションコントロールなどの追加により,より安定したショートライン取引戦略に改良することができる.

ストラテジーソースコード
/*backtest
start: 2022-09-22 00:00:00
end: 2023-09-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 31/05/2019
// This is a modified version of the three line break price representation. 
// It is composed with 2 lines made of Close price values forming a “cloud”.
//    If the trend is bullish and the price breach the lower level of the green 
//       cloud, a new bearish trend is taking place.
//    If the current trend is bearish and the price breakout the upper band of 
//       the cloud, a new bullish trend is forming.
// This is a “price action” indicator, signals may be filtered by long term trend 
// analysis with other indicators such as Supertrend for instance.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Three Line Break", overlay = true)
reverse = input(false, title="Trade reverse")
xtrend = 1
xu = close
xu1 = close
xu2 = close
xu3 = close
if xtrend[1] == 1
    if close > xu[1]
        xu3 := xu2[1]
        xu2 := xu1[1]
        xu1 := xu[1]
        xu := close
        xtrend := 1
    else 
        if close < xu3[1]
            xu3 := xu1[1]
            xu2 := xu1[1]
            xu1 := xu1[1]
            xu := close
            xtrend := -1        
        else
            xtrend := 1
else
    if close > xu3[1]
        xu3 := xu1[1]
        xu2 := xu1[1]
        xu1 := xu1[1]
        xu := close
        xtrend := 1
    else
        if close < xu[1] 
            xu3 := xu2[1]
            xu2 := xu1[1]
            xu1 := xu[1]
            xu := close
            xtrend := -1
        else
            xtrend := -1
colorm = xtrend == -1 ? red: xtrend == 1 ? green : blue 
possig = iff(reverse and xtrend == 1, -1,
          iff(reverse and xtrend == -1, 1, xtrend))	   
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 ? red: possig == 1 ? green : blue ) 		
p1 = plot(xu, color=colorm)
p2 = plot(xu3, color=colorm)
fill(p1, p2, color=colorm)