Munich Guppy
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © CheatCode1

//@version=5
indicator("Munich Guppy", overlay = true)

//Dominant Momentum ALMA
dsource = input.source(close, title='Source', group='Dominant ALMA')
dperiod = input.int(title='Period', defval=130, group='Dominant ALMA')
doffset = input.float(title='Offset', step=0.025, defval=0.775, group='Dominant ALMA')
dsigma = input.float(title='Sigma', step=0.5, defval=4.5, group='Dominant ALMA')

dalma = ta.alma(dsource, dperiod, doffset, dsigma)

dalma_up_color = input.color(#66bb6a, '+Coc', group='Dominant ALMA', inline = '1')
dalma_down_color = input.color(#ef5350, '-Coc', group='Dominant ALMA', inline = '1')
dcolor = close[1] > dalma ? dalma_up_color : dalma_down_color

////ALMA Plots//
plot(dalma, color=dcolor, style=plot.style_stepline, linewidth=2, title='Dominant Momentum MA', offset = 0)

//MMV1
// Input value grouping

//Variable Declerations
V = input.int(200, 'MA 3',  1, 201, group = 'EMA\'s')   
e11 = input.int(21, 'EMA 1', 1, 100, group = 'EMA\'s')
e12 = input.int(55, 'EMA 2', 1, 100, group = 'EMA\'s')
e21 = ta.ema(close, e11)
e55 = ta.ema(close, e12)
eV = ta.ema(close, V)
ec = dalma < e21 and close > e21 and dalma[1] < e21[1] and close[1] > e21[1] and dalma[2] < e21[2] and close[2] > e21[2]

plot(e21, '21 White', e21 < dalma and dalma > close[1] ? color.red: e21 > dalma and dalma < close[1] ? color.green:color.white, 3, plot.style_line, offset = 0)
plot(e55, '55 Purple', e55 < dalma ? color.purple: color.gray, 3, plot.style_line, offset =0 )
plot(eV, 'MA V Aqua', color.aqua, 2, offset = 0)

er1 = e55 > dalma and e21 > dalma
er2 = e55 < dalma and e21 < dalma
er1C = er1[1] == true
er2C = er2[1] == true
bgcolor(er1C ? color.new(color.green, 80) : er2C ? color.new(color.red, 80): na, offset = 1)
//










