볼링거 + RSI 더블 전략 (오직 장기) v1.2

저자:차오장, 날짜: 2023-12-08 10:39:52
태그:

img

I. 전략 이름

볼링거 밴드 + RSI 더블 롱 전략

전략 개요

이 전략은 볼링거 밴드 지표와 RSI 지표를 결합하여 둘 다 과잉 판매 신호를 표시할 때 긴 지점을 취하고 둘 다 과잉 구매 신호를 표시할 때 긴 지점을 닫습니다. 단일 지표와 비교하면 거래 신호를 보다 안정적으로 확인하고 잘못된 신호를 피할 수 있습니다.

III. 전략 원칙

  1. RSI 인디케이터를 사용하여 과잉 구매/ 과잉 판매를 판단합니다.
    • 50 이하의 RSI는 과판된 것으로 간주됩니다.
    • 50 이상의 RSI는 과잉 매입된 것으로 간주됩니다.
  2. 가격 극단성을 판단하기 위해 볼링거 대역을 사용
    • 낮은 가격대에는 과잉 판매가
    • 상위 범위를 넘는 가격은 과잉 구매
  3. RSI와 볼링거 밴드 모두 과잉 판매 신호를 표시 할 때 길게 가십시오.
    • 50 이하의 RSI
    • 보링거 하위 대역 아래의 가격
  4. RSI와 볼링거 밴드 모두 과잉 매수 신호를 표시할 때 긴 포지션을 닫습니다.
    • RSI 50 이상
    • 볼링거 상단 위에 있는 가격

IV. 전략의 강점

  1. 두 개의 표시기를 결합하면 신호가 더 신뢰할 수 있고 잘못된 신호를 피할 수 있습니다.
  2. 단지 긴 포지션만이 논리를 단순화하고 거래 위험을 줄여줍니다.

V. 전략 위험 및 해결책

  1. 부적절한 볼링거 밴드 매개 변수 설정, 너무 넓은 상위/하위 밴드는 잘못된 거래 위험을 증가시킵니다
    • 볼링거 밴드 매개 변수를 최적화하고 합리적인 기간과 표준편차를 설정합니다.
  2. 부적절한 RSI 매개 변수 설정, 잘못된 과잉 구매/ 과잉 판매 기준은 잘못된 거래 위험을 증가시킵니다.
    • RSI 매개 변수를 최적화하고, RSI 기간을 조정하고, 합리적인 과반 구매/ 과반 판매 기준을 설정합니다.
  3. 시장이 동향이 없을 때 수익성이 낮습니다.
    • 추세 지표와 결합하여 불안정한 시장을 피하십시오.

전략 최적화 방향

  1. 볼링거 밴드 및 RSI 매개 변수 설정을 최적화합니다.
  2. 스톱 손실 메커니즘을 추가합니다.
  3. MACD와 같은 트렌드 지표와 결합
  4. 단기 분석과 장기 분석의 조합을 추가합니다

VII. 요약

이 전략은 볼링거 밴드와 RSI 지표의 강점을 결합하여 둘 다 극단적 인 경우 거래를합니다. 이것은 단일 지표에서 잘못된 신호를 피하고 신호 정확도를 향상시킵니다. 이전 버전과 비교하면 긴 포지션을 설정하는 것 만으로 거래 위험을 줄일 수 있습니다. 향후 최적화는 매개 변수 조정, 스톱 로스 메커니즘, 트렌드 지표와 결합하여 전략을 다른 시장 환경에 적응 할 수 있습니다.


/*backtest
start: 2023-11-30 00:00:00
end: 2023-12-07 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("Bollinger + RSI, Double Strategy Long-Only (by ChartArt) v1.2", shorttitle="CA_-_RSI_Bol_Strat_1.2", overlay=true)

// ChartArt's RSI + Bollinger Bands, Double Strategy UPDATE: Long-Only
//
// Version 1.2
// Idea by ChartArt on October 4, 2017.
//
// This strategy uses the RSI indicator 
// together with the Bollinger Bands 
// to buy when the price is below the
// lower Bollinger Band (and to close the
// long trade when this value is above
// the upper Bollinger band).
//
// This simple strategy only longs when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a oversold condition.
//
// In this new version 1.2 the strategy was
// simplified by going long-only, which made
// it more successful in backtesting. 
//
// List of my work: 
// https://www.tradingview.com/u/ChartArt/
// 
//  __             __  ___       __  ___ 
// /  ` |__|  /\  |__)  |   /\  |__)  |  
// \__, |  | /~~\ |  \  |  /~~\ |  \  |  
// 
// 


///////////// RSI
RSIlength = input(6,title="RSI Period Length") 
RSIoverSold = 50
RSIoverBought = 50
price = close
vrsi = rsi(price, RSIlength)


///////////// Bollinger Bands
BBlength = input(200, minval=1,title="Bollinger Period Length")
BBmult = 2 // input(2.0, minval=0.001, maxval=50,title="Bollinger Bands Standard Deviation")
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
source = close
buyEntry = crossover(source, BBlower)
sellEntry = crossunder(source, BBupper)
plot(BBbasis, color=aqua,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=silver,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=silver,title="Bollinger Bands Lower Line")
fill(p1, p2)


///////////// Colors
switch1=input(true, title="Enable Bar Color?")
switch2=input(true, title="Enable Background Color?")
TrendColor = RSIoverBought and (price[1] > BBupper and price < BBupper) and BBbasis < BBbasis[1] ? red : RSIoverSold and (price[1] < BBlower and price > BBlower) and BBbasis > BBbasis[1] ? green : na
barcolor(switch1?TrendColor:na)
bgcolor(switch2?TrendColor:na,transp=50)


///////////// RSI + Bollinger Bands Strategy
long = (crossover(vrsi, RSIoverSold) and crossover(source, BBlower))
close_long = (crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper))

if (not na(vrsi))

    if long
        strategy.entry("RSI_BB", strategy.long, stop=BBlower, comment="RSI_BB")
    else
        strategy.cancel(id="RSI_BB")
        
    if close_long
        strategy.close("RSI_BB")


//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)

더 많은