Here is the code for four indicators combined into one. and you can customize the settings
//@version=4
study("Combined Indicators", overlay=true)
//CALCULATION SECTION
//Stochastics Calculation
smoothK = input(3, "K")
smoothD = input(3, "D")
slength = input(14, minval=1, title="Length")
src = input(close, title="Source")
StochK = sma(stoch(src, high, low, slength), smoothK)
StochD = sma(StochK, smoothD)
//Williams %R Calculation
length = input(title="Length", type=input.integer, defval=14)
overbought = input(title="Overbought Level", type=input.float, defval=-20)
oversold = input(title="Oversold Level", type=input.float, defval=-80)
highestHigh = highest(high, length)
lowestLow = lowest(low, length)
williamsR = (highestHigh - close) / (highestHigh - lowestLow) * -100
//RSI Calculation
rsiLength = input(14, "RSI Length")
rsiOverBought = input(70, "RSI Overbought")
rsiOverSold = input(30, "RSI Oversold")
rsi = rsi(close, rsiLength)
//MACD Calculation
fastLength = input(12, title="Fast Length")
slowLength = input(26, title="Slow Length")
signalLength = input(9, title="Signal Smoothing")
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
signal = ema(macd, signalLength)
hist = macd - signal
//Stochastics Plot
//plot(StochK, "Stoch K", color=#5B8DE7)
//plot(StochD, "Stoch D", color=#FDE803)
//Williams %R Plot
//plot(williamsR, color=color.blue, title="Williams %R")
//hline(overbought, color=color.red, linestyle=hline.style_dashed, title="Overbought")
//hline(oversold, color=color.green, linestyle=hline.style_dashed, title="Oversold")
//RSI Plot
//plot(rsi, "RSI", color=#3ADF00)
//hline(rsiOverBought, title="Overbought", color=#FF0000)
//hline(rsiOverSold, title="Oversold", color=#00FF00)
//MACD Plot
//plot(macd, "MACD", color=#FF6B6B)
//plot(signal, "Signal", color=#9BFFAF)
//plot(hist, "Histogram", color=#B0B0B0)
CombOsc = ((StochD+StochK)/2 + macd + rsi + williamsR)/4
plot(CombOsc, "Combined", color=color.yellow)