Script 2
Script 2
Script 2
indicator("Current Week High/Low, Previous Day High/Low, Daily Open with Bollinger Bands",
shorttitle="Current Week High/Low & Prev HL & Daily Open", overlay=true)
// Daily Open
dailyOpen = request.security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on)
// EMA
emaLength = input.int(20, minval=1, title="EMA Length")
ema = ta.ema(close, emaLength)
// Bollinger Bands
length = input.int(20, minval=1, title="Bollinger Bands Length")
src = close
mult = input.float(2.0, minval=0.001, maxval=50, title="Bollinger Bands StdDev")
basis = ta.sma(src, length)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
// Plotting
plot(currentWeekHigh, color=color.green, style=plot.style_stepline, linewidth=2, title="Current Week High")
plot(currentWeekLow, color=color.red, style=plot.style_stepline, linewidth=2, title="Current Week Low")
plot(prevDayHigh, color=prevHighColor, style=plot.style_stepline, linewidth=2, title="Previous Day High")
plot(prevDayLow, color=prevLowColor, style=plot.style_stepline, linewidth=2, title="Previous Day Low")
plot(dailyOpen, color=openColor, style=plot.style_stepline, linewidth=2, title="Daily Open")
plot(upper, color=bullishTilt ? color.green : color.red, linewidth=2, title="Upper Bollinger Band")
plot(lower, color=bearishTilt ? color.red : color.green, linewidth=2, title="Lower Bollinger Band")
plot(basis, color=color.blue, linewidth=2, title="Bollinger Band Basis")
plot(ema, color=coilingColor, style=plot.style_line, linewidth=2, title="EMA Price Coiling")
t = time("1440", session.extended) // 1440=60*24 is the number of minutes in a whole day. You may use "0930-
1600" as second session parameter
//plot(t, style=linebr) // debug
is_first = na(t[1]) and not na(t) or t[1] < t
plotshape(is_first, color=color.red, style=shape.arrowdown)
plot(day_high, color=color.lime)
plot(day_low, color=color.red)