line.get_price() - Pine Script Function
line.get_price()
Section titled “line.get_price()”Overview
Section titled “Overview”Returns the price level of a line at a given bar index.
Syntax
Section titled “Syntax”line.get_price(id, x) → series floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | series line | Line object. |
Returns
Section titled “Returns”Price value of line ‘id’ at bar index ‘x’.
Remarks
Section titled “Remarks”- The line is considered to have been created using ‘extend=extend.both’.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("GetPrice", overlay=true)var line l = naif bar_index == 10 l :=line.new(0, high[5], bar_index, high)plot(line.get_price(l, bar_index), color=color.green)