Skip to main content
Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: chartPoint · Entries: 6

chartPoint (library)

Definition Five functions that build a chart point — new, from_time, from_index, now and copy — for the type of the same name, whose three fields are a time, an index and a price. Drawing functions take chart points: line.new, box.new and polyline.new accept them, and label.set_point, line.set_point1, line.set_point2, box.set_top_left_point and box.set_bottom_right_point set a drawing’s position from one. Example

chartPoint.copy (function)

Definition Hands back a copy of a chart point. One argument, required: the point to copy. Syntax
Parameters Returns series chartPoint A new chartPoint with the same coordinates as id. Example

chartPoint.from_index (function)

Definition Builds a chart point from a bar index and a price. Both arguments are required. Where you would rather locate the point by time, use chartPoint.from_time. Syntax
Parameters Returns series chartPoint A chartPoint with the given bar index and price. Example

chartPoint.from_time (function)

Definition 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
Parameters Returns series chartPoint A chartPoint with the given UNIX time and price. Example

chartPoint.new (function)

Definition Builds a chart point with all three of its fields given: a time, a bar index and a price. All three arguments are required. Use one of the narrower constructors where you have only two of the three. Syntax
Parameters Returns series chartPoint A chartPoint with the given time, index, and price. Example

chartPoint.now (function)

Definition Builds a chart point from a price alone: you give no time and no bar index, and even the price is optional. The point is placed at the current bar: its index is bar_index, its time is the open time of the bar (the same value as time), and its price is price. Syntax
Parameters Returns series chartPoint A chartPoint at the current bar, with the given price (default close). Example