Jdawg Sentiment Momentum Oscillator Enhanced
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jbbarrett231

//@version=5
indicator("Jdawg Sentiment Momentum Oscillator Enhanced", shorttitle="JSMO_E", overlay=false)

// Input parameters
src = close
rsiPeriod = input.int(10, title="RSI Period", minval=1)
smaPeriod = input.int(7, title="SMA Period", minval=1)
rocPeriod = input.int(5, title="ROC Period", minval=1)
rocWeight = input.float(0.2, title="ROC Weight", minval=0, maxval=1, step=0.01)

// Calculate the RSI
rsi = ta.rsi(src, rsiPeriod)

// Calculate the SMA of RSI
smaRsi = ta.sma(rsi, smaPeriod)

// Calculate the ROC of RSI
rocRsi = ta.roc(rsi, rocPeriod)

// Calculate the Enhanced SMO
smo = rsi - smaRsi + (rocRsi * rocWeight)

// Plot the Enhanced SMO with blue color
plot(smo, title="JSMO Enhanced", color=color.blue, linewidth=3)

// Plot zero line
hline(0, "Zero Line", color=color.gray, linestyle=hline.style_dashed)

// Plot Overbought and Oversold levels
overbought1 = input.int(21, title="Overbought Level 1", minval=1)
oversold1 = input.int(-21, title="Oversold Level 1", minval=-100)
overbought2 = input.int(42, title="Overbought Level 2", minval=1)
oversold2 = input.int(-42, title="Oversold Level 2", minval=-100)

hline(overbought1, "Overbought 1", color=color.red, linestyle=hline.style_dashed)
hline(oversold1, "Oversold 1", color=color.green, linestyle=hline.style_dashed)
hline(overbought2, "Overbought 2", color=color.red, linestyle=hline.style_solid)
hline(oversold2, "Oversold 2", color=color.green, linestyle=hline.style_solid)
