High Low Yesterday

My friends, this is a very simple script, but it has some work to function the way it currently does.

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.

Open-source script

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.

Want to use this script on a chart?


Hi Thanks for sharing. If it can help you, here is a script that plots pre-markets high and lows. -----> Extended Session High/Low by freedom_trader_
+15 Reply
Hi Rodrigo,

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.

//@author=Rodrigo Prieto
//December 2019
//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,, linewidth=1, style=plot.style_linebr)

fill(a,b,color=(useColors? yClose>yOpen ? : (yClose < yOpen ? : : color.white) ) // fills body with red/green color (according resolution)

+5 Reply
Simple but Great. is there any way you can add or link Fib Retracement and extension based on previous day High Low
How do I use this
Superb bro, if possible can you add Monthly High Low also, it's useful for Buy Low Sell High
can you pl guide one thing, I want to compare current day movement with previous day movement in terms of %, and want to see the difference in screen. Pl help me
Hey , Very useful script this is , i am not a coder but want to thank you so much . I appreciate your effort.
Can you help first candle of high and low should marked automatically?? is there any script available
How to add or subtract this high and low difference in next days opening price????