ATR 및 변동 지수 기반 트렌드 추적 전략

저자:차오장, 날짜: 2024-01-04 15:31:34
태그:

img

전반적인 설명

이 전략은 트렌드를 식별하고 추적하는 주요 기술 지표로 평균 진정한 범위 (ATR) 및 CHOP 지수를 사용합니다. 지수가 상부 및 하부 레일을 뚫고 진입 신호로 트렌드 방향과 결합했을 때 입력됩니다. 지수가 벨트 영역에 다시 진입 할 때 손해를 멈추거나 이익을 취하하며 종료됩니다.

전략 원칙

  1. ATR을 사용하여 상자 크기를 계산하고 렌코 채널을 구성하여 가격 트렌드 방향을 결정합니다.

  2. CHOP 인덱스를 적용하여 시장이 거래에 적합한지 판단하십시오. 이 인덱스는 가장 높은 가격, 가장 낮은 가격 및 ATR을 포함합니다. 38.2-61.8 사이의 경우 낮은 시장 변동성을 나타냅니다. 그렇지 않으면 높은 변동성과 적합하지 않은 거래 시장을 나타냅니다.

  3. CHOP 인덱스가 61.8의 상단 레일을 깨면 가격이 하향 추세로 진입합니다. 단기 빠른 EMA가 또한 가격이 선도적 인 것을 보여줍니다. CHOP 인덱스가 38.2의 하단 레일을 깨고 단기 EMA가 상승하면 길게 가십시오.

  4. 스톱 로스/프로프트 전략 사용. 가격이 CHOP의 38.2-61.8 벨트 영역으로 다시 들어가면 스톱 로스 또는 프로프트로 포지션을 닫습니다.

이점 분석

이 전략은 트렌드 판단과 변동성 통제를 결합하여 가격 트렌드를 포착하고 위험을 제어 할 수 있습니다. 비교적 안정적인 트렌드 추적 전략입니다.

  1. ATR이 만든 렌코 채널은 가격 동향을 효과적으로 추적할 수 있습니다.

  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)
    

더 많은