fi - 5EMA + BB
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vazkez


//Indicador adaptado a medida sobre "4EMA lines EMA Cross @Philacone + Bollinger Bands by Alessiof"
//Todos los meritos para Alessiof, muchas gracias!!!

//@version=5
indicator(title="fi - 5EMA + BB", shorttitle="fi-5EMAS", overlay = true, timeframe="", timeframe_gaps=true)

//------------ENTRADAS----------------------------
Ema10  = input.int(10 ,"EMA 10" , minval=1, group="Emas")
Ema21  = input.int(21 ,"EMA 21" , minval=1, group="Emas")
Ema50  = input.int(50 ,"EMA 50" ,minval=1 , group="Emas")
Ema100 = input.int(100,"EMA 100", minval=1, group="Emas")
Ema200 = input.int(200,"EMA 200", minval=1, group="Emas")

//------------VARIABLES----------------------------
xPrice = close
xEMA1 = ta.ema(xPrice, Ema10)
xEMA2 = ta.ema(xPrice, Ema21)
xEMA3 = ta.ema(xPrice, Ema50)
xEMA4 = ta.ema(xPrice, Ema100)
xEMA5 = ta.ema(xPrice, Ema200)

//------------SALIDAS----------------------------
plot(xEMA1, color=color.new(color.yellow, transp=0) ,linewidth=2, title="EMA 10")  //Color amarillo
plot(xEMA2, color=color.new(color.lime,   transp=0) ,linewidth=2, title="EMA 21")  //Color lima
plot(xEMA3, color=color.new(#FF3371,      transp=0) ,linewidth=2, title="EMA 50")  //Color rojo brillante
plot(xEMA4, color=color.new(#33D7FF,      transp=0) ,linewidth=2, title="EMA 100") //Color azul cielo
plot(xEMA5, color=color.new(color.blue,   transp=0) ,linewidth=2, title="EMA 200") //Color azul

//------------BANDAS DE BOLLINGER----------------------------
    // ENTRADAS BB
length = input.int(20, minval=1, title="Longitud BB", group="Bandas de Bollinger")
src    = input(close, title="Fuente BB", group="Bandas de Bollinger")
mult   = input.float(2, minval=0.0001, maxval=50, title="Multiplicador BB", group="Bandas de Bollinger")

    // VARIABLES BB
basis = ta.sma(src, length)
dev   = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev

    // SALIDA BB
plot(basis, title="BB Media", color=color.new(color.gray,15), style=plot.style_circles)
p1 = plot(upper, title="BB Superior", color=color.new(color.gray,15))
p2 = plot(lower, title="BB Inferior", color=color.new(color.gray,15))
fill(p1, p2, color=color.new(color.white,95), title="BB Fondo")



