TradingView
rodrigo.aprieto
2019年12月20日早上1點02分

High Low Yesterday 

Apple Inc.NASDAQ

描述

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.


發布通知

  • Added the ability to select another resolution to plot the previous high and previous low. Previously it was limited to yesterday's high/low (according to the name of the script). Several users have requested this should be useful.
  • Added support to create alert conditions. You can now create three different alerts with this script: Breakout Previous High, Breakout Previous Low and Breakout Rejected.


Thanks so much to all the users that are using and reporting improvements to this indicator.

Happy trading!
Rodrigo

發布通知

In this version we have fixed the breakout that occurs in the first candle of the day.
The crossover and crossunder function was not properly working when crossing the previous day high or low for the first candle.
See for example the January 14, 2023 0:00 UTC or Feb, 16 2023 0:00 UTC for BTCUSDT.

Thanks to @tronsom (tradingview.com/u/tronsom/) for reporting the issue.

發布通知

Couple of additions to this script: the mid price.

  • Calculate and plot the mid Price that is the middle line between yesterday's High and yesterday's Low.
  • Calculate the crossing up and down the yesterday's mid price and send custom alert for both conditions.
  • Add new parameters to allow the user to choose if they want to see the mid price or not. Similar for mid price cross alerts.
  • Organize the code for improved reading.

評論
raychartss
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_
VikontTrade
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.

//
//@version=4
//@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[1],gaps=igaps, lookahead=barmerge.lookahead_on) // takes information for
yClose = security(t,res,close[1],gaps=igaps, lookahead=barmerge.lookahead_on) // candle body

yesterdayHigh = security(t,res,high[1],gaps=igaps, lookahead=barmerge.lookahead_on)
yesterdayLow = security(t,res,low[1],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)
//

Regards,
Vikont
tronsom
Just what I was looking for and with the bonus breakout plots. Excellent work, Rodrigo! Would be great if we could add a way to only show the previous day's high/low and not every day's.
ganuda
Superb bro, if possible can you add Monthly High Low also, it's useful for Buy Low Sell High
iannn
would be awesome if after it breaks yday high or low, it doesnt paint bg color for rest of the day. using this to consciously know when we are tarding an 'inside day' so with this change it would stop it from painting unnecessarily
vivianloharts
awesome
sraj6639
Nice
j3srv
When using this indicator, the chart includes these when scaling, meaning if yesterdays high or low is real far from current price it squashes the price bars to include these in the chart viewing area. Any way to edit this so my price bars don't squash?
rodrigo.aprieto
@j3srv, the best way you can do to adjust the vertical y-axis to the price candles and to not include the height of the indicators you can plotted in the chart is to right-click into the prices at right and select "Scale price chart only". Please see image attached for reference: i.imgur.com/KCBVwnw.png
j3srv
@RodriGo.aprieto, Thank you! I’m new to TV and hadn’t noticed that.
更多