
이 전략은 부린 띠를 주요 지표로 사용하고 있으며, 종결 가격이 상도를 돌파할 때 과다 포지션을 열고, 하도를 돌파할 때 빈 포지션을 열습니다. 부린 띠는 중도 ((중동 평균), 상도 ((중도 + 표준 차차), 하도 ((중도 - 표준 차차) 로 구성되어 있습니다. 이 전략은 시장 추세를 포착하기 위해 부린 띠를 돌파할 때 구매하고, 하도를 돌파할 때 판매하며, 중도를 평정 포지션 조건으로 사용합니다.
부린띠 돌파전 전략은 부린띠의 상하 궤도의 돌파를 통해 시장 경향을 포착하고, 중도 궤도가 평형 조건이다. 이 전략의 논리는 명확하고, 구현하기 쉬운, 효과적으로 트렌드를 포착할 수 있지만, 매개 변수 선택과 흔들리는 시장에서 일정 위험이 존재한다. 미래에는 다른 지표, 최적화 매개 변수, 위험 관리 등을 도입함으로써 전략 성능을 향상시킬 수 있다.
/*backtest
start: 2023-04-24 00:00:00
end: 2024-04-29 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Bollinger Bands Strategy", shorttitle='BB Strategy', overlay=true)
// Bollinger Bands parameters
length = input.int(20, title="Length")
mult = input.float(2.0, title="Multiplier")
// Calculate Bollinger Bands
basis = ta.sma(close, length)
dev = mult * ta.stdev(close, length)
upper_band = basis + dev
lower_band = basis - dev
// Plot Bollinger Bands
plot(basis, color=color.blue, title="Basis")
plot(upper_band, color=color.red, title="Upper Band")
plot(lower_band, color=color.green, title="Lower Band")
// Strategy
long_condition = ta.crossover(close, upper_band)
short_condition = ta.crossunder(close, lower_band)
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
// Exit conditions
exit_long_condition = ta.crossunder(close, basis)
exit_short_condition = ta.crossover(close, basis)
if (exit_long_condition)
strategy.close("Long")
if (exit_short_condition)
strategy.close("Short")