This strategy combines the Bollinger Bands and Stoch RSI indicators for multiple indicator trading. It belongs to the typical combined indicators strategy type. The Bollinger Bands determine trend direction and the Stoch RSI optimizes entry timings for trade signals.
The strategy is based on two main indicators:
Calculate the upper, middle and lower bands. A buy signal is generated when price breaks above the lower band.
Calculate the Stoch RSI indicator. A buy signal is generated when the K line crosses above the D line.
The specific trading logic is: open long when both the Bollinger Bands lower breakout and Stoch RSI golden cross occur together.
The exit logic uses the bands for take profit and stop loss: close for profit when price touches the upper or middle band again, close for loss when price breaks back below the lower band.
Risks can be reduced by:
The strategy can be improved by:
Adjust upper/lower calculation ratios for best fit
Finding optimal K and D values
Avoid false signals relying on single indicator
Trail stops based on price volatility
Optimal parameters vary across different products
This strategy leverages the Bollinger Bands for trend direction and Stoch RSI for entry optimization, taking advantage of a multi-indicator approach. But challenges like difficult parameter optimization and signal accuracy exist. Rigorous backtesting for parameter optimization, adding filters, and continuously adjusting rules based on results can improve accuracy while retaining the strengths of a combined system. Persistent optimizations lead to robustness.
/*backtest
start: 2022-09-14 00:00:00
end: 2023-09-20 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy(title = "BB+RSI v2", overlay = true)
price=close
////////// /////// BB /////////////////////////
bblength = input(50)
bbupmult =input(2,step=0.1,title="Multiplier for BB Upper Band")
bblowmult = input(2,step=0.1,title="Multiplier for BB Lower Band")
basis = sma(close,bblength)
devup = bbupmult * stdev(close, bblength)
devlow = bblowmult * stdev(close, bblength)
upper = basis + devup
lower = basis - devlow
plot(basis, color=red)
p1 = plot(upper, color=blue)
p2 = plot(lower, color=blue)
fill(p1, p2)
bbbuy= crossover(price,lower)
bbsell = crossunder(price,upper) or price>upper or crossunder(price,basis)
//////////////////// BB //////////////////////
//////////////////////// S RSI /////////////////////
lengthrsi = input(6)
overSold = input( 20 )
overBought = input( 70 )
vrsi = rsi(price, lengthrsi)
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
src = input(close, title="RSI Source")
rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
SRSIbuy=crossover(k,d)
////////////////////// S RSI ///////////////////////
// Conditions
longcond = bbbuy and SRSIbuy
closelong = bbsell
monthfrom =input(6)
monthuntil =input(12)
dayfrom=input(1)
dayuntil=input(31)
if ( longcond )
strategy.entry("BUY", strategy.long, stop=close, oca_name="TREND", comment="BUY")
else
strategy.cancel(id="BUY")
if ( closelong )
strategy.close("BUY")