Creates a chart point at the bar being processed, priced at the close unless you pass a price.
The index and time fields come from the bar the script is running on, and the price is the close when no argument is given. It is chart.point.new(time, bar_index, close) in one short call.
Pass a price to keep the bar but choose the level: chart.point.now(high) anchors at the high of this bar.
Syntax
chart.point.now(price: series int/float (optional)) -> chart.pointArguments
| Name | Type | Default | Description |
|---|---|---|---|
| price | series int/ | close | Price level of the point. When left out the current bar's close is used. |
Returns
chart.point: A new chart.point on the current bar.
Example
//@version=6
indicator("chart.point.now: to now", overlay = true)
var float startPx = na
if bar_index == 0
startPx := close
if barstate.islast
line.new(chart.point.from_index(0, startPx), chart.point.now(), extend = extend.right)See also
Runs on Sidechair