ATRと波動指数に基づくトレンド追跡戦略

作者: リン・ハーンチャオチャン,日付: 2024-01-04 15時31分34秒
タグ:

img

概要

この戦略は,トレンドを特定し,追跡するための主要な技術指標として,平均真のレンジ (ATR) とCHOPインデックスを使用します.指数が上下線を突破すると,エントリー信号としてトレンド方向と組み合わせて入力します.指数がベルトエリアに戻るとストップ損失または利益を得て終了します.

戦略原則

  1. 箱のサイズを計算するために ATR を使用し,価格傾向の方向性を決定するために Renko チャネルを構築します.

  2. CHOPインデックスを使用して,市場が取引に適しているかどうかを判断します.このインデックスは最高価格,最低価格,ATRを組み込みます. 38.2-61.8 の範囲では,市場変動が低いことを示します.そうでなければ,高い変動と不適切な取引市場を示します.

  3. CHOPインデックスが61.8の上部レールを破ると,価格は下落傾向に入ります.短期間の高速EMAも価格がリードしていることを示している場合,ショートします.逆に,CHOPが38.2の下部レールを破って短期EMAが上昇すると,ロングします.

  4. Stop loss/take profit 戦略を使用します.価格がCHOPの 38.2-61.8帯域に戻ると,ストップ・ロストまたは取利益でポジションを閉じる.

利点分析

この戦略は,トレンド判断と波動性制御を組み合わせ,価格動向を把握し,リスクを制御することができます.これは比較的安定したトレンド追跡戦略です.

  1. ATRが構築したRenkoチャンネルは 価格動向を効果的に追跡できます

  2. CHOPインデックスは,激しい変動の際に不正な取引を避けるため,市場の変動率を判断します.

  3. 短期のトレンド方向を決定するために高速EMAを組み合わせることで逆転操作を回避できます

  4. ストップ・ロスト/テイク・プロフィート戦略は単一の損失を制御する.

リスク分析

この戦略が直面する主なリスクは

  1. 横向市場では,ATRチャンネルとCHOP信号が誤った信号を生成することがあります.誤った信号を適切にフィルタリングするために細かな調整パラメータ.

  2. 単一の技術指標の組み合わせは,損失を完全に回避することはできません.主要な傾向を決定するには手動的な介入が必要です.

  3. ストップ損失ポジションを太りすぎに設定すると,単一の損失が大きすぎる可能性があります.ストップ損失の大きさを適切に絞るべきです.

最適化方向

この戦略は,次の側面で最適化できます.

  1. 信号の正確性を向上させるために,キャンドルスタイルのパターン,音量など,信号を決定するために他の補助指標を増やす.

  2. 価格変動をより良く把握するために ATR と CHOP のパラメータを最適化します.

  3. ダイナミックなストップ・ロース/テイク・プロフィートポジションを設定し,より大きな利益率とより速いストップ・ロースを得ます.

  4. 主なトレンドを決定した後,ストップロスの範囲を適切に緩め,トレンドでより多くの利益を得ます.

結論

この戦略は,一般的に使用される技術指標を統合し,シンプルで実践的です.パラメータ調整と最適化により,満足のいく追跡効果を得ることができます.しかし,依然として主要な傾向の手動判断を必要とし,完全に自動化することはできません.それは補助的な意思決定ツールとして機能し,他の戦略のための参照となります.


/*backtest
start: 2022-12-28 00:00:00
end: 2024-01-03 00:00: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/
// © sharatgbhat

//@version=4
strategy("Weis Chop Strategy", overlay=false, default_qty_type = strategy.percent_of_equity, default_qty_value = 10,max_lines_count = 500, max_labels_count = 500)
maxIdLossPcnt = input(1, "Max Intraday Loss(%)", type=input.float)
// strategy.risk.max_intraday_loss(maxIdLossPcnt, strategy.percent_of_equity)

method = input(defval="ATR", options=["ATR", "Traditional", "Part of Price"], title="Renko Assignment Method")
methodvalue = input(defval=14.0, type=input.float, minval=0, title="Value")
pricesource = input(defval="Close", options=["Close", "Open / Close", "High / Low"], title="Price Source")
useClose = pricesource == "Close"
useOpenClose = pricesource == "Open / Close" or useClose
useTrueRange = input(defval="Auto", options=["Always", "Auto", "Never"], title="Use True Range instead of Volume")
isOscillating = input(defval=false, type=input.bool, title="Oscillating")
normalize = input(defval=false, type=input.bool, title="Normalize")
vol = useTrueRange == "Always" or useTrueRange == "Auto" and na(volume) ? tr : volume
op = useClose ? close : open
hi = useOpenClose ? close >= op ? close : op : high
lo = useOpenClose ? close <= op ? close : op : low

if method == "ATR"
    methodvalue := atr(round(methodvalue))
if method == "Part of Price"
    methodvalue := close / methodvalue

currclose = float(na)
prevclose = nz(currclose[1])
prevhigh = prevclose + methodvalue
prevlow = prevclose - methodvalue
currclose := hi > prevhigh ? hi : lo < prevlow ? lo : prevclose

direction = int(na)
direction := currclose > prevclose ? 1 : currclose < prevclose ? -1 : nz(direction[1])
directionHasChanged = change(direction) != 0
directionIsUp = direction > 0
directionIsDown = direction < 0

barcount = 1
barcount := not directionHasChanged and normalize ? barcount[1] + barcount : barcount
vol := not directionHasChanged ? vol[1] + vol : vol
res = barcount > 1 ? vol / barcount : vol

plot(isOscillating and directionIsDown ? -res : res, style=plot.style_columns, color=directionIsUp ? color.green : color.red, transp=75, linewidth=3, title="Wave Volume")

length = input(14, minval=1)
ci = 100 * log10(sum(atr(1), length) / (highest(length) - lowest(length))) / log10(length)
offset = input(0, "Offset", type = input.integer, minval = -500, maxval = 500)
plot(ci, "CHOP", color=#2962FF, offset = offset)
band1 = hline(61.8, "Upper Band", color=#787B86, linestyle=hline.style_dashed)
band0 = hline(38.2, "Lower Band", color=#787B86, linestyle=hline.style_dashed)
fill(band1, band0, color = color.rgb(33, 150, 243, 90), title = "Background")

MomentumBull = close>ema(close,8)
MomentumBear = close<ema(close,8)
Tradecon = crossunder(ci,61.8)

if (MomentumBull and directionIsUp and Tradecon)
	strategy.entry("Buy", strategy.long)
if (MomentumBear and directionIsDown and Tradecon )
    strategy.entry("Sell", strategy.short)
    strategy.exit("exit","Buy",when=directionIsDown,qty_percent=100,profit=20,loss=10)
    strategy.exit("exit","Sell",when=directionIsUp,qty_percent=100,profit=20,loss=10)
    

もっと