
이 전략은 부린 띠와 이동 평균의 두 가지 기술 지표를 결합하여 부린 띠와 가격의 상대적 위치와 빠른 이동 평균의 교차 신호를 통해 시장 추세를 판단하여 선택적 구매를 실현합니다. 가격이 부린 띠를 돌파 할 때 더 많은 포지션을 열고, 경로를 돌파 할 때 더 많은 포지션을 열고, 경로를 돌파 할 때 더 많은 포지션을 열고, 빠른 이동 평균을 돌파 할 때 더 많은 포지션을 열고, 낮은 이동 평균을 돌파합니다. 이 전략은 투자자가 시장 추세를 파악하고, 안정적인 투자 수익을 얻을 수 있도록 도와줍니다.
부린띠 교차 이동 평균 전략은 부린띠를 통해 과매매를 판단하고, 평평선 교차 판단 경향을 활용하여, 시장 추세를 효과적으로 파악하고, 안정적인 수익을 달성할 수 있는 고전적인 트렌드 추적 전략이다. 그러나 실제 적용에서는 회귀를 제어하고, 파라미터를 최적화하고, 다른 방법과 결합하여 끊임없이 개선하여, 변화하는 시장 환경에 적응하는 것이 필요하다.
/*backtest
start: 2024-05-01 00:00:00
end: 2024-05-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy(shorttitle="BB Strategy", title="Bollinger Bands Strategy", overlay=true)
// Input parameters
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"])
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
offset = input.int(0, "Offset", minval=-500, maxval=500)
// Moving average 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)
// Calculate Bollinger Bands
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// Plot Bollinger Bands
plot(basis, "Basis", color=color.blue, offset=offset)
p1 = plot(upper, "Upper", color=color.red, offset=offset)
p2 = plot(lower, "Lower", color=color.green, offset=offset)
fill(p1, p2, title="Background", color=color.rgb(33, 150, 243, 95))
// Strategy entry and exit conditions
if (ta.crossover(close, lower))
strategy.entry("Buy", strategy.long)
if (ta.crossunder(close, upper))
strategy.entry("Sell", strategy.short)