다중 지표 볼링거 밴드 거래 전략

저자:차오장, 날짜: 2023-11-15 15:30:43
태그:

img

전반적인 설명

이 전략은 거래 결정을 내리기 위해 볼링거 밴드, RSI 및 MACD와 같은 여러 기술적 지표를 결합합니다. 먼저 차트에 볼링거 밴드를 그래프화하고 엔트리 신호를 위해 밴드 브레이크아웃을 사용합니다. RSI 및 MACD는 엔트리에 대한 추가 필터로 사용됩니다. 전략은 또한 위험을 제어하기 위해 밴드 및 지표에 기반한 스톱 로스 규칙을 설정합니다. 전반적으로 여러 지표의 강점을 활용하는 포괄적 인 전략입니다.

전략 논리

  1. 중앙선, 1std dev 및 2std dev 밴드를 가진 34 기간 볼링거 밴드 그래프.

  2. 상단단위보다 긴 단절이 있을 때 긴 단절을 입력하고, 하단단위보다 긴 단절이 있을 때 짧은 단절을 입력합니다.

  3. 중점선 아래로 접어들면 긴 포지션을 닫고, 중점선 위에 접어들면 짧은 포지션을 닫는다.

  4. RSI>70을 더 추가 확인으로 사용하세요. RSI<30을 더 짧은 확인으로 사용하세요.

  5. RSI가 50을 넘을 때 짧은 포지션을 닫고 RSI가 50을 넘을 때 긴 포지션을 닫습니다.

  6. MACD 크로스오버를 항목에 대한 추가 필터로 사용하십시오.

  7. MACD 크로스오버에서 긴 포지션을 닫고 MACD 크로스오버에서 짧은 포지션을 닫습니다.

  8. 거래에 들어가기 전에 모든 3개 지표가 정렬되어야 합니다. 여러 필터가 잘못된 신호를 줄여줍니다.

장점

여러 지표의 신호를 결합하면 잘못된 신호가 감소하고 수익성이 증가합니다. 볼링거 밴드는 가격 브레이크오웃 신호를 제공하며, RSI는 과잉 구매 / 과잉 판매 영역을 피하고, MACD는 트렌드 변화를 포착합니다.

장과 지표에 기반한 엄격한 스톱 로스 규칙은 모든 거래에서 손실을 제한합니다. 이것은 더 높은 수익성, 승률 및 더 낮은 최대 유출로 이어집니다.

단일 지표 전략과 비교하면 지표를 결합하면 성능이 향상됩니다. 여러 필터는 나쁜 신호를 제거합니다. 손해를 막는 메커니즘은 손실 영향을 제어합니다.

전체적으로 이 전략은 트렌딩 시장에서 탁월하며, 지표 세부 정보를 사용하여 큰 움직임을 피하면서 큰 움직임을 잡습니다. 위험 통제는 더 높은 레버리지를 안전하게 사용할 수 있습니다.

위험성

주요 위험은 다음과 같습니다.

  1. 지표에서 잘못된 신호의 가능성. 매개 변수를 최적화하면 잘못된 신호를 줄일 수 있지만 제거 할 수 없습니다.

  2. 범위에 묶인 시장에서 수익을 창출할 수 없습니다. 단속 과정에서 손실을 초래하는 스톱 손실이 발생할 수 있습니다. 더 오래 거래를 유지하기 위해 스톱 손실 규칙이 느려질 수 있습니다.

  3. 뒤떨어진 지표는 놓친 진입 기회를 초래합니다. 더 진보 된 선도 지표는 더 일찍 턴을 잡는 데 도움이 될 수 있습니다.

  4. 가격 격차는 스톱을 무효화시킵니다. 후속 스톱을 사용하거나 평균을 낮추면 손실을 더 잘 제어 할 수 있습니다.

  5. 고정된 매개 변수는 다른 시장에 대한 조정이 필요할 수 있습니다. 기계 학습은 자동 매개 변수 최적화를 가능하게합니다.

  6. 과도한 적합성을 초래하는 불충분한 테스트 전략은 안정성을 보장하기 위해 시장에서 더 큰 데이터 세트에 테스트해야합니다.

더 나은 기회

이 전략은 여러 가지 방법으로 개선될 수 있습니다.

  1. 잘못된 신호를 최소화하는 최상의 조합을 찾기 위해 지표 매개 변수를 최적화합니다. 무력 힘 또는 최적화 방법이 사용될 수 있습니다.

  2. 고정 중간 밴드 스톱 대신 적응 스톱 손실을 포함합니다. 스톱은 ATR, 트렌드 등에 적응 할 수 있습니다.

  3. 변화하는 조건에서 적응적 매개 변수 최적화를 위해 기계 학습을 사용하십시오. 예를 들어 강화 학습.

  4. 트렌드 탐지 규칙을 추가하여 다른 시장 단계에 대한 다른 전술을 사용합니다. 적응력을 향상시킵니다.

  5. 감정, 소셜 미디어 데이터를 통합하여 다중 요소 예측 및 주요 지표를 향상시킵니다.

  6. 기하급수적인 성장을 위해 증가하는 계정 크기에 기초한 규모의 포지션을 확장하기 위해 합산을 사용하십시오.

  7. 다른 전략과 결합을 최적화하여 다각화를 통해 포트폴리오 변동성을 줄이세요.

결론

이 전략은 견고한 입출 신호를 위해 여러 지표를 결합하고 엄격한 스톱 손실 규율을 시행합니다. 여러 지표를 사용하여 잘못된 신호를 줄이고 스톱 손실 규모를 제어합니다. 안정적인 수익을 제공하는 트렌딩 시장에 잘 작동합니다. 세밀한 조정 매개 변수 및 적응력을 향상하면 성능을 더욱 향상시킬 수 있습니다. 전반적으로 신뢰할 수 있고 안정적이며 효율적인 거래 시스템입니다.


/*backtest
start: 2023-10-15 00:00:00
end: 2023-11-14 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
// Bollinger Bands: Madrid : 14/SEP/2014 11:07 : 2.0
// This displays the traditional Bollinger Bands, the difference is 
// that the 1st and 2nd StdDev are outlined with two colors and two
// different levels, one for each Standard Deviation

strategy(shorttitle='MBB', title='Bollinger Bands', overlay=true, currency=currency.NONE, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_value = 0.05)
src = input(close)
length = input.int(34, minval=1)
mult = input.float(2.0, minval=0.001, maxval=50)

basis = ta.sma(src, length)
dev = ta.stdev(src, length)
dev2 = mult * dev

upper1 = basis + dev
lower1 = basis - dev
upper2 = basis + dev2
lower2 = basis - dev2

colorBasis = src >= basis ? color.blue : color.orange

pBasis = plot(basis, linewidth=2, color=colorBasis)
pUpper1 = plot(upper1, color=color.new(color.blue, 0), style=plot.style_circles)
pUpper2 = plot(upper2, color=color.new(color.blue, 0))
pLower1 = plot(lower1, color=color.new(color.orange, 0), style=plot.style_circles)
pLower2 = plot(lower2, color=color.new(color.orange, 0))

fill(pBasis, pUpper2, color=color.new(color.blue, 80))
fill(pUpper1, pUpper2, color=color.new(color.blue, 80))
fill(pBasis, pLower2, color=color.new(color.orange, 80))
fill(pLower1, pLower2, color=color.new(color.orange, 80))


//Strategy code starts here

long_entry = ta.crossover(src, upper1)
short_entry = ta.crossunder(src, lower1)

strategy.entry("Long", strategy.long, when=long_entry)
strategy.entry("Short", strategy.short, when=short_entry)

if long_entry or close < basis
    strategy.close("Long", "Long") 

if short_entry or close > basis
    strategy.close("Short", "Short") 


//Calculate RSI
rsiLength = input(14)
rsiValue = ta.rsi(src, rsiLength)

// Define RSI conditions for entering and exiting trades
rsiLong = rsiValue > 70
rsiShort = rsiValue < 30


//Enter long position when RSI crosses above 50 and Bollinger Bands long entry condition is met
strategy.entry("Long", strategy.long, when=long_entry and rsiLong)

//Exit long position when RSI crosses below 50 or Bollinger Bands exit condition is met
strategy.close("Long Exit", when=rsiShort or close < basis)

//Enter short position when RSI crosses below 50 and Bollinger Bands short entry condition is met
strategy.entry("Short", strategy.short, when=short_entry and rsiShort)

//Exit short position when RSI crosses above 50 or Bollinger Bands exit condition is met
strategy.close("Short Exit", when=rsiLong or close > basis)



//Calculate MACD
fastLength = input(12)
slowLength = input(26)
macdLength = input(9)
macdValue = ta.macd(src, fastLength, slowLength, macdLength)

// Define MACD conditions for entering and exiting trades
macdLong = ta.crossover(src, macdLength)
macdShort = ta.crossunder(src, macdLength)

//Enter long position when MACD crosses above signal line and RSI and Bollinger Bands long entry condition is met
strategy.entry("Long", strategy.long, when=long_entry and rsiLong and macdLong)

//Exit long position when MACD crosses below signal line or RSI crosses below 50 or Bollinger Bands exit condition is met
strategy.close("Long Exit", when=macdShort or rsiShort or close < basis)

//Enter short position when MACD crosses below signal line and RSI crosses below 50 and Bollinger Bands short entry condition is met
strategy.entry("Short", strategy.short, when=short_entry and rsiShort and macdShort)

//Exit short position when MACD crosses above signal line or RSI crosses above 50 or Bollinger Bands exit condition is met
strategy.close("Short Exit", when=macdLong or rsiLong or close > basis)

더 많은