TradingView
fikira
15 lip 2022 17:09

chart visible bar time 

Bitcoin / U.S. dollarBitstamp

Opis

With the latest added features chart.left_visible_bar_time and chart.right_visible_bar_time it is now possible to
place label.new() positions at the equivalent of 'location.top' and 'location.bottom'

The following are examples of functions which enables to find the visible chart highest/lowest bars:
highest_visible_chart() => var float highs = na highs := time == chart.left_visible_bar_time ? high : time > chart.left_visible_bar_time and high > highs ? high : highs lowest_visible_chart() => var float lows = na lows := time == chart.left_visible_bar_time ? low : time > chart.left_visible_bar_time and low < lows ? low : lows


In this example labels are plotted when a sma crosses another sma

Also combined with 3 boxes, scrolling gives insights how the features work

To all who make Tradingview the way it is, lots and lots of thanks!

Cheers!

Informacje o Wersji

Added label which gives the current time and time from left & right bar of the visible chart (adjustable by UTC)

In this case the label is not deleted through code on each new bar, because the script is reloaded every bar
(due to chart.right_visible_bar_time, chart.left_visible_bar_time), hence 'starting with a clean slate'

Informacje o Wersji

+ extra information regarding time format

Informacje o Wersji

update

Informacje o Wersji

Added label which keeps track of latest price, even if you scrolling back

Informacje o Wersji

This script is part of a collection of educational scripts
If you want to return to the open source INDEX page, click here
-> Education: INDEX
Komentarze
truthfulRice14003
Put hull,pivot,trendlines, harmonic and Elliot
fikira
@truthfulRice14003, you can do this yourself, it is open source. I do not code on demand.
JohnMuchow
Excellent educational content! Thank you!
fikira
@JohnMuchow, Thanks! Appreciate it very much!
UnknownUnicorn15320316
is repsint?
fikira
@Bafrali1453, The chart is cleaned every new bar, if you'd interpreted this as repaint, yes, but here are some remarks:
- This script is made to show the possibilities of chart.left_visible_bar_time, chart.right_visible_bar_time to get a label at the top/bottom of the chart
- You'll see the position of the labels (x) is always correct, above/below a cross (except at the present bar, but this is not considered repaint)
- The 3 boxes do repaint, but they are merely for visuals, providing something visual of what is going on.

Cheers
Więcej