PINE LIBRARY
已更新 Algebra

Library "Algebra"
Algebra functions.
line_fromXy(x1, y1, x2, y2)
Get line slope and y-intercept from coordinates
Parameters:
x1: x coordinate 1 (int - bar index)
y1: y coordinate 1 (float - price/value)
x2: x coordinate 2 (int - bar index)
y2: y coordinate 2 (float - price/value)
Returns: [slope, y-intercept] of line
line_getPrice(x, slope, yInt)
Get line slope and y-intercept from coordinates
Parameters:
x: x coordinate to solve for y (int - bar index)
slope: slope of line (float)
yInt: y-intercept of line (float)
Returns: y (price/value)
Algebra functions.
line_fromXy(x1, y1, x2, y2)
Get line slope and y-intercept from coordinates
Parameters:
x1: x coordinate 1 (int - bar index)
y1: y coordinate 1 (float - price/value)
x2: x coordinate 2 (int - bar index)
y2: y coordinate 2 (float - price/value)
Returns: [slope, y-intercept] of line
line_getPrice(x, slope, yInt)
Get line slope and y-intercept from coordinates
Parameters:
x: x coordinate to solve for y (int - bar index)
slope: slope of line (float)
yInt: y-intercept of line (float)
Returns: y (price/value)
發行說明
v2New functions:
line_getRightTriSides() - Get length of sides of a right triangle formed by a given line
line_length() - Get length of line, given a line object or two sets of coordinates
Added:
line_getRTriSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
Parameters:
x1: x coordinate 1 (int - optional, required if argument l is not specified)
y1: y coordinate 1 (float - optional, required if argument l is not specified)
x2: x coordinate 2 (int - optional, required if argument l is not specified)
y2: y coordinate 2 (float - optional, required if argument l is not specified)
l: line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: [a (Δy), b (Δx), c (Hypotenuse)]
line_length(x1, y1, x2, y2, l)
Get length of line, given a line object or two sets of coordinates
Parameters:
x1: x coordinate 1 (int - optional, required if argument l is not specified)
y1: y coordinate 1 (float - optional, required if argument l is not specified)
x2: x coordinate 2 (int - optional, required if argument l is not specified)
y2: y coordinate 2 (float - optional, required if argument l is not specified)
l: line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: length of line (float)
發行說明
v3Renamed line_getRTriSides() to line_getRtSides()
Added:
line_getRtSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
Parameters:
x1: x coordinate 1 (int - optional, required if argument l is not specified)
y1: y coordinate 1 (float - optional, required if argument l is not specified)
x2: x coordinate 2 (int - optional, required if argument l is not specified)
y2: y coordinate 2 (float - optional, required if argument l is not specified)
l: line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: [a (Δy), b (Δx), c (Hypotenuse)]
Removed:
line_getRTriSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
發行說明
v4Added:
line_getPrice_fromXy(x, x1, y1, x2, y2)
Get price at X coordinate, given two points on a line
Parameters:
x: x coordinate to solve for y (int - bar index)
x1: x coordinate 1 (int - bar index)
y1: y coordinate 1 (float - price/value)
x2: x coordinate 2 (int - bar index)
y2: y coordinate 2 (float - price/value)
Returns: y (price/value)
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。