//@version=5 indicator(title='Maestro - JMAC', shorttitle='Maestro - JMAC', timeframe='') // Getting inputs fast_length = input(title='Fast', defval=5) slow_length = input(title='Slow', defval=28) src = input(title='Calculation', defval=ohlc4) sma_source = input.string(title='Oscillator Type', defval='SMA', options=['SMA', 'EMA']) // Plot colors col_grow_above = input.color(#26A69A, 'Above   Grow', group='Color Gradient', inline='Above') col_fall_above = input.color(#B2DFDB, 'Fall', group='Color Gradient', inline='Above') col_grow_below = input.color(#FFCDD2, 'Below Grow', group='Color Gradient', inline='Below') col_fall_below = input.color(#FF5252, 'Fall', group='Color Gradient', inline='Below') // Calculating fast_ma = sma_source == 'SMA' ? ta.sma(src, fast_length) : ta.ema(src, fast_length) slow_ma = sma_source == 'SMA' ? ta.sma(src, slow_length) : ta.ema(src, slow_length) jmac = fast_ma - slow_ma plot(jmac, title='JMAC', style=plot.style_columns, color=jmac >= 0 ? jmac[1] < jmac ? col_grow_above : col_fall_above : jmac[1] < jmac ? col_grow_below : col_fall_below)