
이 전략은 이동 평균(MA)과 볼린저 밴드를 결합한 추세 추종 거래 시스템입니다. 이 전략은 가격과 200기간 이동평균선 간의 위치적 관계와 볼린저 밴드의 위치를 분석하여 시장 동향을 파악하는 동시에, 고정 비율의 손절매 메커니즘을 통합하여 위험을 통제합니다. 이 전략은 35배 레버리지에 맞춰 2.86%의 포지션 관리를 채택하고, 신중한 펀드 관리 개념을 반영합니다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 고전적인 기술 지표를 결합하여 완벽한 거래 시스템을 구축하는데, 이는 추세를 포착하는 능력이 뛰어나고 위험 관리 효과가 뛰어납니다. 이 전략의 핵심적인 장점은 높은 수준의 체계화와 강력한 매개변수 조정성에 있으며, 고정된 손절매 메커니즘을 통해 효과적인 위험 관리가 달성됩니다. 변동성이 큰 시장에서는 성과가 좋지 않을 수 있지만, 최적화된 방향을 구현하면 전략의 안정성과 수익성을 더욱 개선할 수 있습니다. 실제 거래에 사용할 경우 거래자는 시장 환경 선택에 주의를 기울이고, 자신의 위험 허용 범위에 맞게 매개변수 설정을 조정하는 것이 좋습니다.
/*backtest
start: 2024-11-26 00:00:00
end: 2024-12-25 08:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("MA 200 and Bollinger Bands Strategy", overlay=true) // 2.86% for 35x leverage
// inputs
ma_length = input(200, title="MA Length")
bb_length = input(20, title="Bollinger Bands Length")
bb_mult = input(2.0, title="Bollinger Bands Multiplier")
// calculations
ma_200 = ta.sma(close, ma_length)
bb_basis = ta.sma(close, bb_length)
bb_upper = bb_basis + (ta.stdev(close, bb_length) * bb_mult)
bb_lower = bb_basis - (ta.stdev(close, bb_length) * bb_mult)
// plot indicators
plot(ma_200, color=color.blue, title="200 MA")
plot(bb_upper, color=color.red, title="Bollinger Upper Band")
plot(bb_basis, color=color.gray, title="Bollinger Basis")
plot(bb_lower, color=color.green, title="Bollinger Lower Band")
// strategy logic
long_condition = close > ma_200 and bb_basis > ma_200 and ta.crossover(close, bb_lower)
short_condition = close < ma_200 and bb_basis < ma_200 and ta.crossunder(close, bb_upper)
// fixed stop loss percentage
fixed_stop_loss_percent = 3.0 / 100.0
if (long_condition)
strategy.entry("Long", strategy.long)
strategy.exit("Stop Long", "Long", stop=strategy.position_avg_price * (1 - fixed_stop_loss_percent))
if (short_condition)
strategy.entry("Short", strategy.short)
strategy.exit("Stop Short", "Short", stop=strategy.position_avg_price * (1 + fixed_stop_loss_percent))
// take profit conditions
close_long_condition = close >= bb_upper
close_short_condition = close <= bb_lower
if (close_long_condition)
strategy.close("Long")
if (close_short_condition)
strategy.close("Short")