3EMA + Boullinger + PIVOT
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © JCMR76

//@version=4
study("3EMA + Boullinger + PIVOT", overlay=true)


// TRES EMAS - THREE EMA´s
periodo1 = input(8, title="Periodo 1, Length 1=", step =1, minval=1, maxval=300)
periodo2 = input(20, title="Periodo 2, Length 2=", step =1, minval=1, maxval=300)
periodo3 = input(200, title="Periodo 3, Length 3=", step =1, minval=1, maxval=1000)


plot(ema(close,periodo1), color=color.gray, linewidth=1)
plot(ema(close,periodo2), color=color.green, linewidth=1)
plot(ema(close,periodo3), color=color.purple, linewidth=3)

//BANDA BOLLINGER - BANDS BOLLINGER
longitudbb   = input(20,title = "longitudBB, LenghtBB=", type = input.integer, step = 1, minval=1, maxval=50)
multbb       = input(2.0, title = "Multiplicadorbb, EstDesv = ", type= input.float, step = 0.2, minval=0.2, maxval=20)
fuente       = input(close, title="fuente", type=input.source)
[mm,banda_sup, banda_inf] = bb(fuente, longitudbb,multbb)
ps=plot(banda_sup, color=color.new(color.gray, 90))
pi=plot(banda_inf, color=color.new(color.gray, 90))
fill(ps,pi,color=color.new(color.gray,80))

//PIVOT - PIVOTE
dist = input(6, title ="distancia para el pivote/ distance to pivot ", type = input.integer, step = 1)

pl = pivotlow(low, dist, dist)
if not na(pl)
    label.new(bar_index[dist], pl, text="Buy", style=label.style_label_up, textcolor=color.yellow, size=size.small, color=color.green)

ph = pivothigh(high, dist, dist)
if not na(ph)
    label.new(bar_index[dist], ph, text="Sell",style=label.style_label_down, textcolor=color.yellow, size=size.small, color=color.red)
//PIVOT - PIVOTE


