Asian Session Bollinger Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © greenmask9

//@version=4
study("Asian Session Bollinger Bands", shorttitle = "ASBB", overlay = true)


i_frank_ny = input(defval = "0100-1400", title = "Frankfurt Open -> New York Close", type = input.session, group = "Time")
tradeRange = input("1400-0100", "Asian Session", input.session, group = "Time")

timeinrange(res, sess) => time(res, sess) != 0

frank_ny = timeinrange(timeframe.period, i_frank_ny)
Asian = timeinrange(timeframe.period, tradeRange)

//BB

hide = input(false, title = "Hide Lines?")
hide_2 = input(true, title = "Plot only between 20-00 and Frankfurt?")
hide_3 = input(true, title = "Plot only in Asian")

invisible_color = hide ? color.new(color.blue, 100) : color.navy

disappearer = hide_2 ? not frank_ny ? true : false : true
disappearer_2 = hide_3 ? Asian ? true : false : true

c_disappearers = disappearer and disappearer_2



length = input(20, title = "Length")
mult = 2.0
basis = sma(close, length)
dev = mult * stdev(close, length)
upper = basis + dev
lower = basis - dev
p1 = plot(c_disappearers ? upper : na, "Upper", color=invisible_color, style = plot.style_linebr)
p2 = plot(c_disappearers ? lower : na, "Lower", color=invisible_color, style = plot.style_linebr)
p3 = plot(c_disappearers ? basis : na, "Lower", color=invisible_color, style = plot.style_linebr)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 94))












