
알파트렌드 쌍방향 추적 전략은 알파트렌드 지표의 구매 및 판매 신호에 따라 거래를하는 전략이다. 이 전략은 알파트렌드 지표의 구매 및 판매 신호를 생성하는 지역에서 다단계 및 공백 위치를 열 수 있다.
알파트렌드 쌍방향 추적 전략의 핵심은 알파트렌드 지표이다. 알파트렌드 지표는 자체 적응 평균 실제 파장 ((ATR) 과 가격 ((폐쇄 가격 또는 거래량 중화 평균 가격) 의 조합을 기반으로 상도 및 하도 계산한다. 구체적인 계산 방법은 다음과 같다.
상행 = 최저 가격 - ATR * 인수 하위 궤도 = 최고 가격 + ATR * 인수
여기서 ATR은 과거 일정 주기 동안의 평균 실제 파도이며, 계수는 조정 가능한 변수이다. 가격이 상단보다 높을 때, 지표선은 상단으로 가깝고, 가격이 하단보다 낮을 때, 지표선은 하단으로 가깝다. 이렇게 AlphaTrend 지표는 스스로 적응하는 통로를 형성한다.
알파트렌드 쌍방향 추적 전략은 알파트렌드 지표의 신호를 기반으로 다단계 및 공백점 포지션을 구축합니다. 구체적인 논리는 다음과 같습니다:
이는 AlphaTrend 지표의 동적 통로를 기반으로 한 쌍방향 추적 거래가 완료되었습니다.
알파 트렌드 쌍방향 추적 전략의 가장 큰 장점은 시장 추세의 변화를 추적 할 수 있다는 것입니다. 적응형 ATR은 시장의 변동성에 따라 채널 범위를 조정할 수 있으며, 전통적인 부린 밴드와 같은 지표가 변동률의 확대에 의해 쉽게 실패하는 문제를 피할 수 있습니다.
또한, 알파 트렌드 지표는 가격과 거래량 (또는 동력) 을 결합하여 몇 가지 가짜 돌파구를 필터링 할 수 있습니다. 이것은 전략 신호의 질을 향상시킵니다.
알파 트렌드 쌍방향 추적 전략의 주요 위험은 거대한 시장의 흔들림이 지표 통로에 미치는 충격에서 비롯된다. 시장이 비정상적인 변동이있을 때, 정지점이 뚫려 큰 손실을 초래할 가능성이 있다. 이것은 ATR 파라미터와 정지점을 적절히 조정하여 위험을 제어해야합니다.
또한, ALPHA 지표 자체는 약간의 지연이 있을 것이다. 따라서 시장의 전환점 근처에서도 잘못된 신호가 발생할 것이다. 이것은 확인하기 위해 다른 지표의 보조가 필요하다.
알파 트렌드 쌍방향 추적 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.
위와 같은 몇 가지 최적화를 통해 AlphaTrend 전략의 안정성과 수익성을 더욱 높일 수 있습니다.
알파 트렌드 쌍방향 추적 전략은 전체적으로 시장 변화를 추적하는 효과적인 전략이다. 그것은 전통적인 기술 지표가 쉽게 실패하는 문제를 해결하고 또한 거래량을 결합하여 신호를 필터링한다. 적절히 최적화하면 이 전략은 양적 거래 시스템에서 강력한 도구가 될 수 있다.
/*backtest
start: 2024-01-02 00:00:00
end: 2024-02-01 00:00:00
period: 1h
basePeriod: 15m
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/
// author © KivancOzbilgic
// developer © KivancOzbilgic
//@version=5
strategy('AlphaTrend', shorttitle='AT', overlay=true, format=format.price, precision=2)
coeff = input.float(1, 'Multiplier', step=0.1)
AP = input(14, 'Common Period')
ATR = ta.sma(ta.tr, AP)
src = input(close)
showsignalsk = input(title='Show Signals?', defval=true)
novolumedata = input(title='Change calculation (no volume data)?', defval=false)
upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(src, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT < nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT : downT > nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT
color1 = AlphaTrend > AlphaTrend[2] ? #00E60F : AlphaTrend < AlphaTrend[2] ? #80000B : AlphaTrend[1] > AlphaTrend[3] ? #00E60F : #80000B
k1 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3)
k2 = plot(AlphaTrend[2], color=color.new(#FC0400, 0), linewidth=3)
fill(k1, k2, color=color1)
buySignalk = ta.crossover(AlphaTrend, AlphaTrend[2])
sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])
K1 = ta.barssince(buySignalk)
K2 = ta.barssince(sellSignalk)
O1 = ta.barssince(buySignalk[1])
O2 = ta.barssince(sellSignalk[1])
//plotshape(buySignalk and showsignalsk and O1 > K2 ? AlphaTrend[2] * 0.9999 : na, title='BUY', text='BUY', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))
//plotshape(sellSignalk and showsignalsk and O2 > K1 ? AlphaTrend[2] * 1.0001 : na, title='SELL', text='SELL', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white, 0))
longCondition = buySignalk and showsignalsk and O1 > K2
if (longCondition)
strategy.entry("BUY", strategy.long, comment = "BUY ENTRY")
shortCondition = sellSignalk and showsignalsk and O2 > K1
if (shortCondition )
strategy.entry("SELL", strategy.short, comment = "SELL ENTRY")
// alertcondition(buySignalk and O1 > K2, title='Potential BUY Alarm', message='BUY SIGNAL!')
// alertcondition(sellSignalk and O2 > K1, title='Potential SELL Alarm', message='SELL SIGNAL!')
// alertcondition(buySignalk[1] and O1[1] > K2, title='Confirmed BUY Alarm', message='BUY SIGNAL APPROVED!')
// alertcondition(sellSignalk[1] and O2[1] > K1, title='Confirmed SELL Alarm', message='SELL SIGNAL APPROVED!')
// alertcondition(ta.cross(close, AlphaTrend), title='Price Cross Alert', message='Price - AlphaTrend Crossing!')
// alertcondition(ta.crossover(low, AlphaTrend), title='Candle CrossOver Alarm', message='LAST BAR is ABOVE ALPHATREND')
// alertcondition(ta.crossunder(high, AlphaTrend), title='Candle CrossUnder Alarm', message='LAST BAR is BELOW ALPHATREND!')
// alertcondition(ta.cross(close[1], AlphaTrend[1]), title='Price Cross Alert After Bar Close', message='Price - AlphaTrend Crossing!')
// alertcondition(ta.crossover(low[1], AlphaTrend[1]), title='Candle CrossOver Alarm After Bar Close', message='LAST BAR is ABOVE ALPHATREND!')
// alertcondition(ta.crossunder(high[1], AlphaTrend[1]), title='Candle CrossUnder Alarm After Bar Close', message='LAST BAR is BELOW ALPHATREND!')