Basically it prints the HIGH and LOW from previous day into the current day. This forms like a channel.
It's useful to visually detect when the price cross over the yesterday's high, or close under yesterday's low.
You can activate/deactivate colors as input parameter:
- Price above a previous high: fills green.
- Price below a previous low: fills red.
- Price inside previous low/high: fills blue.
Hope this helps to you too.
This only works for intraday resolutions only (less than 1D)
More to come: I'm working to include pre-market low/high for the current trading day.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
Thank you for the script, took is as source code.
Added some modifications, feel free to update yours if you want. Don't want to make duplicates.
//Modded by VT
study("High Low Yesterday_mod",overlay=true,shorttitle="High Low Yesterday")
useColors = input(title="Fill with colors?",defval=true)
res = input(title="Resolution", defval="W", type=input.resolution) // option to change resolution without going into code
isess = session.regular
t = tickerid(syminfo.prefix, syminfo.ticker, session=isess)
igaps = barmerge.gaps_off
yOpen = security(t,res,open,gaps=igaps, lookahead=barmerge.lookahead_on) // takes information for
yClose = security(t,res,close,gaps=igaps, lookahead=barmerge.lookahead_on) // candle body
yesterdayHigh = security(t,res,high,gaps=igaps, lookahead=barmerge.lookahead_on)
yesterdayLow = security(t,res,low,gaps=igaps, lookahead=barmerge.lookahead_on)
// Plot the other time frame's data
a=plot(timeframe.isintraday ? yOpen : na, color=color.gray, linewidth=1, style=plot.style_linebr) // Draws body of the candle in Gray
b=plot(timeframe.isintraday ? yClose : na, color=color.gray, linewidth=1, style=plot.style_linebr) //
plot(timeframe.isintraday ? yesterdayHigh : na, color=color.lime, linewidth=1, style=plot.style_linebr)
plot(timeframe.isintraday ? yesterdayLow : na, color=color.red, linewidth=1, style=plot.style_linebr)
fill(a,b,color=(useColors? yClose>yOpen ? color.green : (yClose < yOpen ? color.red : color.blue) : color.white) ) // fills body with red/green color (according resolution)