Functions
chartPoint.from_time()
Builds a chart point from a time and a price. Both arguments are required. It is the time-based counterpart of chartPoint.from_index.
Syntax
chartPoint.from_time(series int time, series float price) → series chartPoint
Arguments
time required series int The x-coordinate of the point, expressed as a UNIX time value, in milliseconds. price required series float The y-coordinate of the point. Return Type
series chartPoint Example
//@lipi=2
indicator("chartPoint.from_time Example", overlay=true)
if barstate.islast {
p = chartPoint.from_time(time, close)
pts = array.new<chartPoint>(0)
array.push(pts, p)
array.push(pts, chartPoint.from_time(time[5], high[5]))
polyline.new(pts, xloc=xloc.bar_time, line_color=color.teal)
}