
이 전략은 부린 밴드 (Bollinger Bands) 의 동적 돌파를 기반으로 한 양적 거래 시스템이다. 이 전략은 여러 가지 이동 평균 유형 (SMA, EMA, SMMA, WMA, VWMA 등) 을 결합하여 부린 밴드를 구성하고, 가격과 부린 밴드 궤도 및 하향과의 관계를 통해 거래 결정을 내린다. 전략의 핵심 아이디어는 가격이 부린 밴드를 궤도 돌파할 때 상승 추세를 포착하고, 가격이 하향을 돌파할 때 적시에 손실을 막는 것이다.
전략의 작동 원리는 다음과 같은 몇 가지 핵심 요소를 포함합니다.
이것은 브린 띠를 기반으로 한 완전한 거래 시스템이며, 잘 적응하고 확장할 수 있습니다. 여러 가지 이동 평균 유형 선택과 유연한 파라미터 설정을 통해 다양한 시장 환경에 적응할 수 있습니다. 전략의 위험 관리 메커니즘은 상대적으로 완벽하지만 여전히 최적화 할 여지가 있습니다. 전략의 안정성과 수익성을 높이기 위해 신호 확인 메커니즘의 강화와 위험 관리의 최적화에 중점을 두는 것이 좋습니다.
/*backtest
start: 2024-06-30 00:00:00
end: 2025-02-18 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
*/
//@version=6
strategy(shorttitle="BB Demo", title="Demo GPT - Bollinger Bands", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Inputs
length = input.int(20, minval=1, title="Length")
maType = input.string("SMA", "Basis MA Type", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
src = input.source(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
offset = input.int(0, "Offset", minval=-500, maxval=500)
// MA Calculation Function
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
// Indicator Calculations
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// Visual Plots
plot(basis, "Basis", color=color.new(#2962FF, 0), offset=offset)
p1 = plot(upper, "Upper", color=color.new(#F23645, 0), offset=offset)
p2 = plot(lower, "Lower", color=color.new(#089981, 0), offset=offset)
fill(p1, p2, color=color.rgb(33, 150, 243, 95), title="Background")
// Strategy Logic
longCondition = close > upper
exitCondition = close < lower
if longCondition
strategy.entry("Long", strategy.long)
if exitCondition
strategy.close("Long")