OPEN-SOURCE SCRIPT
已更新

chart visible bar time

9 996
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:
Pine Script®
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!
版本注释
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'
版本注释
+ extra information regarding time format
版本注释
update
版本注释
Added label which keeps track of latest price, even if you scrolling back
版本注释
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

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。