ダブルタートルブレイクアウト戦略


作成日: 2023-11-28 16:25:41 最終変更日: 2023-11-28 16:25:41
コピー: 0 クリック数: 690
1
フォロー
1621
フォロワー

ダブルタートルブレイクアウト戦略

概要

双海突破策は,海取引法の突破策とリンダ・ラシュクの移動ストップ原理を融合し,優れた突破性能と厳格なリスク管理を備えている.この策は,価格の上下突破を同時に監視し,突破が発生したときに多額のまたは空白のポジションを確立し,移動ストップと移動ストップの管理ポジションを利用する.

戦略原則

核心論理は,大周期高点で小周期高点を突破する時に空白し,大周期低点の下で小周期低点を突破する時に多めにすることである. ポジションを確立した後,移動ストップと移動ストップを設定し,まずストップを確定するリスクである. ポジション数が設定されたストップ数に蓄積される場合,次の周期でストップをキャンセルし,その後,ポジションを半分に外して移動ストップと移動ストップを設定し,利潤をロックし,差異を追跡する.

具体的には以下の通りです.

  1. 大周期 ((20周期) 高点prevHighと小周期 ((4周期) 高点smallPeriodHighの計算
  2. 最新のK線の高がprevHighより大きく,prevHighがsmallPeriodHighより大きいとき,大周期高が小周期高を突破することを示す.このとき,ポジションがない場合は空いている。
  3. 倉庫を建設した後に移動ストップを設定し,倉庫の位置を逆転した後にストップをキャンセルし,ストップを防止する.
  4. ポジション数が設定された移動ストップサイクルの数 (現在の 0 サイクル) に達すると,次のサイクルのポジションの半分を外し,移動ストップと移動ストップを設定し,価格差を追跡し,利益をロックします.
  5. 低点の突破に類似して,大周期低点と小周期低点の突破関係に基づく多項取引を行う.

優位分析

この戦略は統合的な突破策であり,以下の利点があります.

  1. 双周期海取引法と組み合わせると,突破シグナルを効果的に識別することができる.
  2. モバイル・ストップ・アンド・モバイル・ストップ・テクノロジーを採用し,リスクを厳密にコントロールし,大きな損失を回避する.
  3. 2回出場し,半ポジションを停止し,移動し,全ポジションを停止し,利益をロックする.
  4. 多空と多空の双方向操作を兼ね,多空互換の市場の特徴に合致する.
  5. 追及効果が優れ,強固なディスクパフォーマンス能力がある.

リスク分析

主要なリスクと対応策は以下の通りです.

  1. 偽突破リスク。 周期パラメータを適切に調整して,突破の有効性を確保すべきである。
  2. トレンドと形状を組み合わせてフィルタリングを行い,トレンドの終わりにポジションを建てるのを避ける.
  3. ストップ・損失は冲撃されるリスクである. ストップ・損失幅は適切に緩められ,十分なスペースがあることを保証する.
  4. 移動止損は過度に敏感なリスクである. 止損後の滑点設定を調整して,無駄な止損を避けるべきである.

最適化の方向

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

  1. 突破フィルターで取引量を増やし,突破の真偽を保証する.
  2. トレンド判断の指数に加入し,トレンドの終わりにポジションを建てるのを避ける.
  3. 突破のタイミングを判断するより長い時間周期を組み合わせて,
  4. 機械学習アルゴリズムを追加し,動的最適化パラメータを追加した.
  5. 他の戦略と組み合わせて 統計的アベरेजを実施する

要約する

双海突破戦略は,双周期技術,突破理論と厳格なリスク管理手段を総合的に適用し,高い勝率を維持しながら,収益の安定性を確保する.この戦略モデルは,単純で明確で,理解しやすく,適用しやすい,非常に優れた量化戦略である.この戦略には,多くの最適化余地があり,投資家は,この基礎で革新を行い,より優れた取引システムを構築することができます.

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

//@version=3
strategy(title = "Turtle soup plus one", shorttitle = "Turtle soup plus one", overlay=true)

bigPeriod = input(20)
smallPeriod = input(4)
takeProfitBars = input(0)
trailingStop = input(5, title = "Trailing stop percentages")
if (strategy.position_size == 0)
    strategy.cancel("Long")
    strategy.cancel("Short")
    strategy.cancel("Stop")



stopLossPrice = 0.1
stopLossPrice := nz(stopLossPrice[1])
takeProfitStarted = false
takeProfitStarted := nz(takeProfitStarted[1])

prevHigh = highest(high, bigPeriod - smallPeriod)[smallPeriod]
smallPeriodHigh = highest(high, smallPeriod - 1)[1]
if (high > prevHigh and prevHigh > smallPeriodHigh and close > prevHigh and strategy.position_size == 0)
    strategy.order("Short", strategy.short, stop = prevHigh)

if strategy.position_size < 0 and strategy.position_size[1] == 0
    stopLossPrice := high[1]
    strategy.order("Stop", strategy.long, qty = -strategy.position_size, stop = stopLossPrice)
    takeProfitStarted := false

if (strategy.position_size < 0 and sum(strategy.position_size, takeProfitBars) == strategy.position_size * takeProfitBars and close < strategy.position_avg_price and not takeProfitStarted)
    takeProfitStarted := true
    strategy.cancel("Stop")
    strategy.order("ExitHalf", strategy.long, qty = ceil(-strategy.position_size / 2), stop = close)
    if (strategy.position_size != -1)
        strategy.exit("ExitFull", "Short", qty = -strategy.position_size - ceil(-strategy.position_size / 2), loss = stopLossPrice, trail_price  = close, trail_offset = -(close - strategy.position_avg_price) * trailingStop / 100 / syminfo.mintick)
        

prevLow = lowest(low, bigPeriod - smallPeriod)[smallPeriod]
smallPeriodLow = lowest(low, smallPeriod - 1)[1]
if (low < prevLow and prevLow < smallPeriodLow and close < prevLow and strategy.position_size == 0)
    strategy.order("Long", strategy.long, stop = prevLow)

if strategy.position_size > 0 and strategy.position_size[1] == 0
    stopLossPrice := low[1]
    strategy.order("Stop", strategy.short, qty = strategy.position_size, stop = stopLossPrice)
    takeProfitStarted := false

if (strategy.position_size > 0 and sum(strategy.position_size, takeProfitBars) == strategy.position_size * takeProfitBars and close > strategy.position_avg_price and not takeProfitStarted)
    takeProfitStarted := true
    strategy.cancel("Stop")
    strategy.order("ExitHalf", strategy.short, qty = ceil(strategy.position_size / 2), stop = close)
    if (strategy.position_size != 1)
        strategy.exit("ExitFull", "Long", qty = strategy.position_size - ceil(strategy.position_size / 2),loss = stopLossPrice, trail_price  = close, trail_offset = (close - strategy.position_avg_price) * trailingStop / 100 / syminfo.mintick)

// === Backtesting Dates ===
testPeriodSwitch = input(false, "Custom Backtesting Dates")
testStartYear = input(2018, "Backtest Start Year")
testStartMonth = input(3, "Backtest Start Month")
testStartDay = input(6, "Backtest Start Day")
testStartHour = input(08, "Backtest Start Hour")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,testStartHour,0)
testStopYear = input(2038, "Backtest Stop Year")
testStopMonth = input(12, "Backtest Stop Month")
testStopDay = input(14, "Backtest Stop Day")
testStopHour = input(14, "Backtest Stop Hour")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,testStopHour,0)
testPeriod() =>
    time >= testPeriodStart and time <= testPeriodStop ? true : false
isPeriod = testPeriodSwitch == true ? testPeriod() : true
// === /END
if not isPeriod
    strategy.cancel_all()
    strategy.close_all()