
이 전략은 상대적으로 강한 지수 ((RSI) 와 불린 밴드 ((Bollinger Bands) 의 두 가지 기술 지표를 결합하여, 가격이 불린 밴드 아래로 내려갈 때 구매 신호를 발생시키고, 가격이 불린 밴드 위로 올라갈 때 판매 신호를 발생시킨다. 이 전략은 RSI 지표와 불린 밴드 지표가 동시에 과매 또는 과매 상태에 있을 때만 거래 신호를 유발한다.
RSI와 부린 벨트 이중 전략은 추세와 동력 지표를 결합하여 시장 상태를 비교적으로 종합적으로 판단하고 그에 따른 거래 신호를 줄 수 있습니다. 그러나 이 전략은 불안한 시장에서 좋지 않은 성능을 발휘할 수 있으며 위험 제어 조치를 설정하지 않은 상태에서 신중하게 실행해야합니다. 매개 변수를 최적화하고 다른 지표를 도입하고 합리적인 스톱 스을 설정하는 등의 방법으로 이 전략의 안정성과 수익성을 더욱 향상시킬 수 있습니다.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Bollinger + RSI, Double Strategy (by ChartArt) v1.1", shorttitle="CA_-_RSI_Bol_Strat_1.1", overlay=true)
// ChartArt's RSI + Bollinger Bands, Double Strategy - Update
//
// Version 1.1
// Idea by ChartArt on January 18, 2015.
//
// This strategy uses the RSI indicator
// together with the Bollinger Bands
// to sell when the price is above the
// upper Bollinger Band (and to buy when
// this value is below the lower band).
//
// This simple strategy only triggers when
// both the RSI and the Bollinger Bands
// indicators are at the same time in
// a overbought or oversold condition.
//
// In this version 1.1 the strategy was
// both simplified for the user and
// made more successful in backtesting.
//
// List of my work:
// https://www.tradingview.com/u/ChartArt/
//
// __ __ ___ __ ___
// / ` |__| /\ |__) | /\ |__) |
// \__, | | /~~\ | \ | /~~\ | \ |
//
//
///////////// RSI
RSIlength = input(14,title="RSI Period Length")
RSIoverSold = 30
RSIoverBought = 70
price = close
vrsi = rsi(price, RSIlength)
///////////// Bollinger Bands
BBlength = input(20, minval=1,title="Bollinger Period Length")
BBmult = 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=color.blue,title="Bollinger Bands SMA Basis Line")
p1 = plot(BBupper, color=color.red,title="Bollinger Bands Upper Line")
p2 = plot(BBlower, color=color.green,title="Bollinger Bands Lower Line")
fill(p1, p2)
// Entry conditions
crossover_rsi = crossover(vrsi, RSIoverSold) and crossover(source, BBlower)
crossunder_rsi = crossunder(vrsi, RSIoverBought) and crossunder(source, BBupper)
///////////// RSI + Bollinger Bands Strategy
if (not na(vrsi))
if (crossover_rsi)
strategy.entry("RSI_BB_L", strategy.long, comment="RSI_BB_L")
else
strategy.cancel(id="RSI_BB_L")
if (crossunder_rsi)
strategy.entry("RSI_BB_S", strategy.short, comment="RSI_BB_S")
else
strategy.cancel(id="RSI_BB_S")