이 전략은 알파 트렌드 지표와 부린 테드 전략의 특징을 결합한다. 알파 트렌드 지표는 시장의 추세를 포착하기 위해 사용되며, 부린 테드 전략은 시장의 평균 회귀 특성을 포착하기 위해 사용된다. 전략의 주요 아이디어는: 가격이 부린 테드를 뚫고 궤도에 올랐고 알파 트렌드 지표가 상승했을 때 더 많이; 가격이 부린 테드를 뚫고 궤도에 올랐고 알파 트렌드 지표가 하향했을 때 공백. 전략의 출구는 조건입니다: 가격이 하락했을 때 알파 트렌드 지표가 평정 위치한다.
전략은 트렌드 추적과 평균 회귀의 특성을 결합하여, 트렌드가 분명할 때 트렌드에 밀착하고, 불안정한 시장에서 초과 수익을 얻습니다. AlphaTrend 지표는 가격 움직임에 따라 유연하게 조정할 수 있으며, 트렌드에 대해 더 나은 적응력을 가지고 있습니다. 동시에, 부린 띠는 가격의 상대적으로 높고 낮게 객관적으로 그려낼 수 있습니다. 둘은 효과적인 진입 신호를 형성 할 수 있습니다.
위와 같은 위험에는 다음과 같은 대응이 가능합니다.
전략에는 최적화 할 수있는 많은 공간이 있습니다. 변수 최적화 및 신호 필터링은 전략의 성능을 직관적으로 향상시킬 수 있습니다. 포지션 관리를 도입하면 수익 곡선을 평평하게 할 수 있습니다. 더 유연한 중지 손실 방식은 단일 거래의 위험을 줄일 수 있습니다.
이 전략은 트렌드 추적과 평균으로 돌아가는 두 가지 일반적인 양적 전략 아이디어를 교묘하게 결합하고 있으며, 알파 트렌드 지표와 클래식 브린 밴드 지표를 사용합니다. 알파 트렌드 지표는 가격과 거래량 정보를 최대한 활용하고, 트렌드를 파악하면서 시장의 리듬에 잘 적응합니다. 브린 밴드 지표는 가격의 상대적인 높낮이를 객관적으로 묘사하고, 과매의 기회를 효과적으로 포착합니다. 두 지표의 결합은 트렌드와 가격의 공감을 형성하고, 트렌드 상황과 충격 상황에서 유연한 기회를 잡습니다.
전략의 전체적인 논리는 명확하고, 파라미터 설정은 유연하며, 다양한 품종과 주기에 대해 최적화할 수 있다. 동시에 전략의 위험점도 비교적 분명하며, 포지션 관리 및 손실 중단 측면에서는 추가적인 최적화가 필요하다. 또한, 신호의 신뢰성을 더욱 높이기 위해, 또한 트렌드 타입 지표인 ADX, 동력 지표인 RSI 등을 도입하는 것을 고려할 수 있다.
/*backtest
start: 2023-03-22 00:00:00
end: 2024-03-27 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © brlu99
//@version=5
strategy(title="AlphaTrend and Bollinger Bands 120324 Strategy", shorttitle="AT_BB120324", overlay=true, format=format.price, precision=2, pyramiding=0)
// AlphaTrend Indicator
coeff = input.float(1, 'Multiplier', step=0.1)
AP = input(14, 'Common Period')
ATR = ta.sma(ta.tr, 20)
src = input(close)
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
// Bollinger Bands Strategy
BBPeriod = input.int(20, title="BB Period", minval=1)
BBMultiplier = input.float(2.0, title="BB Multiplier", minval=0.1)
basis = ta.sma(close, BBPeriod)
dev = ta.stdev(close, BBPeriod)
upper = basis + BBMultiplier * dev
lower = basis - BBMultiplier * dev
// Strategy Conditions
longCondition = ta.crossover(close, upper) and ta.crossover(AlphaTrend, AlphaTrend[1])
shortCondition = ta.crossunder(close, lower) and ta.crossunder(AlphaTrend, AlphaTrend[1])
// Exit conditions for Strategy 6
longExit_AT_6 = ta.crossover(close, AlphaTrend)
shortExit_AT_6 = ta.crossunder(close, AlphaTrend)
// Exit condition series
exit1 = input.bool(true, title="Enable Exit Condition for Strategy 1")
// Define exit conditions for each strategy
exit1_condition = close < AlphaTrend ? 1.0 : na
// Strategy Actions
strategy.entry("Buy", strategy.long, when=longCondition)
strategy.entry("Sell", strategy.short, when=shortCondition)
// Exit conditions for Strategy 1
strategy.exit("Buy", "longExit_AT_6", stop = exit1_condition, when =shortExit_AT_6 )
strategy.exit("Sell", "shortExit_AT_6", stop = exit1_condition, when =longExit_AT_6)
// Plotting
plot(AlphaTrend, color=color.blue, title="AlphaTrend")
plot(upper, color=color.green, title="Upper Bollinger Band")
plot(lower, color=color.red, title="Lower Bollinger Band")
// Alerts
alertcondition(longCondition, title='Potential Buy Signal', message='AlphaTrend crossed above Upper Bollinger Band')
alertcondition(shortCondition, title='Potential Sell Signal', message='AlphaTrend crossed below Lower Bollinger Band')