EduardoMattje

Yesterday's open, high, low and close

A very simple script to plot the yesterday's OHLC, to be used in an intraday graph.

There were other scripts like this, but their code was ugly, filthy, smelly, and WET, so I did this.
Notas de Lançamento: You can now choose to hide historical values.
Notas de Lançamento: Fixed the last bar bug that was displaying current day values. Very annoying.
Notas de Lançamento: Wrong graph ops
Notas de Lançamento: Ok now the graph should be right and working.
Notas de Lançamento: In Forex pairs, new data was being retrieved 1 candle before the closing of the day. Now it should be fixed.
Notas de Lançamento: Now you can select which timeframe do you want to pull the data from, so you choose to plot the last week OHLC, or the last month.
Notas de Lançamento: The script is now useful on daily and weekly charts, and you can set the period so that lines are shown on the chart.
Script de código aberto

No verdadeiro espírito TradingView, o autor deste script o publicou com código aberto, para que os traders possam compreendê-lo e verificá-lo. Um brinde ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para utilizá-lo em um gráfico.

Quer usar esse script no gráfico?

Comentários

I need any tutorial, please i can't make yesterday OHLC line, please help me
+5 Resposta
Many thanks!
+1 Resposta
my closes in the futures are false, any suggestions to fix it?
cash markets are fine
Resposta
just wanna say a big thanks for putting this together. easy to use. adds great value.
Resposta
can we get prior day data without using security()? as lookahead=barmerge.lookahead_on is not working for me.... i am on hourly chart, and simply need yesterday's OHLC. Currently i am using security() but its leading to delayed alerts due to repainting... many thanks for your help
Resposta
EduardoMattje vivaan-jiya
@vivaan-jiya, as far as I know using security() is the only way to retrieve the values of other timeframes. If you are getting issues what you can do is use something as

security(syminfo.tickerid, "D", open)

instead of

security(syminfo.tickerid, "D", open, lookahead=barmerge.lookahead_on)

I used this last method in the script because at midnight the first method still was displaying the older values, while the second method was correctly updating it. Try changing the OHLC variables to this:

yesterdayOpen = security(syminfo.tickerid, "D", open)
yesterdayHigh = security(syminfo.tickerid, "D", high)
yesterdayLow = security(syminfo.tickerid, "D", low)
yesterdayClose = security(syminfo.tickerid, "D", close)
Resposta
can we get prior day data without using security()? as lookahead=barmerge.lookahead_on is not working for me.... i am on hourly chart, and simply need yesterday's OHLC. Currently i am using security() but its leading to delayed alerts due to repainting... many thanks for your help
Resposta
Can you add an option to display just yesterdays levels only - not all the preceding days.
Resposta
@kjs1, Ok done
Resposta
Could you add a feature to show previous day only versus historical values?
Thanks
Resposta
Início Rastreador de Fundamentos Rastreador Forex Rastreador de Criptomoedas Calendário Econômico Sobre Recursos gráficos Preços Indique um Amigo Regras da Casa Central de Ajuda Soluções para Sites & Corretoras Widgets Soluções em Gráficos Biblioteca de Gráficos Lightweight Blog & Notícias Twitter