Lipi Reference
Lipi

Functions

line.get_price()

Returns the price of a line at x (interpolated between the two endpoints).

Syntax

                line.get_price(series line id, series int x) → series float
              

Arguments

id required series line Drawing object to modify or query.
x required series int X-coordinate (bar index or time, depending on xloc).

Return Type

series float

Example


          //@lipi=2
indicator("line.get_price Example", overlay=true)
static line l = line(na)
if barstate.islast {
    l := line.new(bar_index[10], high[10], bar_index, high, color=color.red)
}
plot(na(l) ? na : line.get_price(l, bar_index))