
이 전략은 볼링거 밴드 기반의 평균값 회귀 거래 시스템으로, 트렌드 필터와 동적 스톱로드를 결합하여 거래 효과를 최적화한다. 이 전략은 통계학 원리를 적용하여, 가격이 평균값에서 이탈할 때 거래하고, 동시에 기술 지표를 통해 승률을 높이고 위험을 관리한다.
이 전략의 핵심은 다음과 같은 핵심 요소들에 기반합니다.
이것은 고전적인 기술 분석과 현대적인 양적 방법을 결합하는 전략이다. 다중 지표 확인과 엄격한 위험 통제를 통해 전략은 더 나은 실용성을 가지고 있다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-17 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Optimized Bollinger Mean Reversion", overlay=true)
// Bollinger Band Settings
length = input.int(20, title="BB Length")
src = input(close, title="Source")
mult = input.float(2.0, title="BB Multiplier")
// Bollinger Bands Calculation
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// Plot the Bollinger Bands
plot(basis, color=color.blue)
p1 = plot(upper, color=color.red)
p2 = plot(lower, color=color.red)
fill(p1, p2, color=color.rgb(41, 98, 255, 90))
// Trend Filter - 50 EMA
ema_filter = ta.ema(close, 50)
// ATR for Dynamic Stop Loss/Take Profit
atr_value = ta.atr(14)
// Buy condition - price touches lower band and above 50 EMA
buy_condition = ta.crossover(close, lower) and close > ema_filter
// Sell condition - price touches upper band and below 50 EMA
sell_condition = ta.crossunder(close, upper) and close < ema_filter
// Strategy Execution
if (buy_condition)
strategy.entry("Buy", strategy.long)
if (sell_condition)
strategy.entry("Sell", strategy.short)
// Exit with dynamic ATR-based stop loss and take profit
strategy.exit("Take Profit/Stop Loss", from_entry="Buy", limit=2*atr_value, stop=1*atr_value)
strategy.exit("Take Profit/Stop Loss", from_entry="Sell", limit=2*atr_value, stop=1*atr_value)