モメント 爆発 追跡 戦略

作者: リン・ハーンチャオチャン,日付: 2024-03-01 11:08:43
タグ:

img

概要

モメントバースト・トラッキング戦略は,価格変化の百分比を計算して価格突破を判断し,トレンド突破点の高い確率の捕獲を実装するために取引量のシグナルをフィルタリングする.購入信号を起動した後,この戦略は価格トラッキングストップロスを利用して利益をロックし,過度の引き下げを避ける.

戦略原則

この戦略で導入信号を決定するために使用する主な指標は以下のとおりです.

  1. 価格変化の割合 (isFourPercentBull) - 価格が実際に突破したかどうかを判断するために,閉店価格の前日の閉店価格と比較した割合の変化を計算します.

  2. 閉店価格と最高価格の比率 (HighCloseRatio) - 価格突破の強さを決定するために,閉店価格と最高価格の比率を計算します.

  3. トレーディング・ボリューム (volume) - 取引のボリュームが前日より大きいことを要求し,有効な突破を保証する.

  4. 200日間の単純な移動平均 (SMA) - 傾向の方向性を決定するために,閉じる価格と開く価格が200日間のラインよりも高くなる必要があります.

上記の複数の条件が同時に満たされると,購入信号が発信される.その後,戦略は価格追跡ストップロスを利用して積極的にストップロスを停止し,利益をロックする.特に,トレーリングストップロスの計算式は:

trailPrice = close * (100 - trailPercent) / 100

ストップ・ロスの割合は,ストップ・ロスの割合です.これは,価格が上昇する限り,ストップ・ロスの線も利益をロックするために上昇することを保証します.価格がストップ・ロスの線に戻ると,ストップ・ロスを止めるためにポジションを閉じます.

戦略 の 利点

典型的な脱出戦略として,以下の利点があります:

  1. 多条件フィルタリングは 突破の有効性を確保し 偽突破を防ぐ.

  2. 価格トラッキングストップロスを採用します 損失を積極的に削減し,引き下げを最大限に抑えるために利益を固定することができます

  3. 戦略の論理は シンプルで明快で 分かりやすく 最適化できます

戦略 の リスク

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

  1. 損失を完全に回避できない 失敗した脱出の可能性はまだあります

  2. 過剰に攻撃的な追跡停止は頻繁に停止を引き起こす可能性があります.

  3. パラメータの設定が正しくない場合,過剰な取引頻度や信号の見逃しにつながります.

対応するリスクに対する解決策は次のとおりです.

  1. パラメータを最適化し 十分なスペースを確保するために ストップ損失の大きさを減らす

  2. 明確なトレンドが見逃されないように 突破条件を合理的に緩和する.

  3. 戦略の安定性を評価するために 異なる品種をテストします

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

この戦略における停車頻度が高いことを考慮すると,次の方向性をさらに最適化することができる.

  1. 移動平均値,ATR,変動値などの他のストップ損失追跡方法を試す.

  2. 機械学習アルゴリズムを拡張し,過去のデータに基づいて パラメータの組み合わせを比較する判断を訓練する.

  3. 効果を確保するために,ボリュームブレイクに基づいて補助判断条件を追加します.

  4. 異なる品種におけるパラメータ設定の違いを評価し,最適を特定する.

結論

モメンタムバーストトラッキング戦略は,全体的に非常に実践的なトレンドトラッキング戦略である.ブレークアウト戦略で損失と利益を効果的に止めることができず,トレンドを把握する際にリスクを適切に制御する問題を解決する.最適化や機械学習を導入することでさらなる改善の余地があるため,深層の研究と適用に価値がある.


/*backtest
start: 2023-03-01 00:00:00
end: 2023-12-10 05:20:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © doks23

//@version=5
strategy(title = "SD:Momentum Burst", overlay=true, initial_capital=1000,commission_value = 0,slippage = 0,process_orders_on_close=true)

//Check Vol
checkVol = input.bool(defval=false,title="IncludeAvgVolume?")
volSMAlength = input(50, title="VolumeLength")
volumeSma = ta.sma(volume, volSMAlength)
highvolume = volume >= volumeSma
volumeCond=checkVol?highvolume:true

// Profit and Loss
trailPercent    = input.float(title="Trail%", defval=3, step=0.1)

//longCondition
PercentThreshold=input.float(3.8,'BreakoutPercent', step=0.1)
MaxThreshold=input.float(10,'Max Breakout', step=0.1)
HighCloseRatio=input.float(70,'Close to High Ratio', step=1)
float candleCloseBull = ((close[0] - open[0]) / (high[0] - open[0]) * 100)
float isFourPercentBull = (((close[0] - close[1]) / close[1]) * 100)
LongCond=volume > volume[1] and isFourPercentBull > PercentThreshold and candleCloseBull > HighCloseRatio and isFourPercentBull<MaxThreshold
barcolor(color=(LongCond?color.yellow: na),title='BObar')
longCondition= LongCond and volumeCond and close>ta.sma(close,200) and open>ta.sma(close,200)

//Input Strategy
DateCheck=  input.bool(title = 'Custom Date Range?', defval=true,group = 'Strategy')
FromDate=   input(defval = timestamp("1 Jan 2019 00:00"),group = 'Strategy')
ToDate      =input(defval = timestamp("31 Dec 2023 00:00"),group = 'Strategy')
PostionSize =input.string('Contract','Select Position Size',options = ['Percent of Equity','Contract'],group = 'Strategy')
ContractQty =input.int(1,'No of Contract',group = 'Strategy')

//Backtesting Date Range
TimeWindow=true
// Number of Contract
var int trade_qty=na
if(PostionSize=='Contract')
    trade_qty:=ContractQty
else
    trade_qty:= (strategy.equity>strategy.initial_capital)?math.floor(strategy.equity/strategy.initial_capital):ContractQty


//Position Buy
BuyTriggerPrice = ta.valuewhen(longCondition,high,0)
//Trailing price
var float trailPrice    = na
float percentMulti = (100 - trailPercent) / 100
longCondition2=longCondition and TimeWindow
if longCondition2
    strategy.entry("Long", strategy.long,qty=trade_qty,stop = BuyTriggerPrice)
    trailPrice := close*percentMulti
if strategy.position_size>0
    trailPrice := math.max(close*percentMulti,trailPrice[1])
    if low <= trailPrice
        strategy.exit('Exit','Long',stop = trailPrice)
        if strategy.position_size==0     
            trailPrice:=na
// Plot Strategy
var float trail_long_SL=na
if strategy.position_size>0
    trail_long_SL:=trailPrice
else
    trail_long_SL:=na
//Strategy Plot
PlotMA=input.bool(title="Plot MA?", defval=false)
plot(PlotMA?ta.sma(close,10):na,color = color.red,title = '10MA')
plot(PlotMA?ta.sma(close,21):na,color = color.white,title = '21MA')
plot(PlotMA?ta.sma(close,200):na,color = color.orange,title = '200MA')
// plot(trail_long_SL,color = color.gray,style = plot.style_steplinebr,linewidth = 1)

もっと