PINE LIBRARY
Algebra

Library  "Algebra"
line_fromXy(x1, y1, x2, y2)
Get line slope and y-intercept from coordinates
Parameters:
x1 (int): x coordinate 1 (int - bar index)
y1 (float): y coordinate 1 (float - price/value)
x2 (int): x coordinate 2 (int - bar index)
y2 (float): y coordinate 2 (float - price/value)
Returns: [slope, y-intercept] of line
line_getPrice(x, slope, yInt)
Get price at X coordinate, given line slope and y-intercept
Parameters:
x (int): x coordinate to solve for y (int - bar index)
slope (float): slope of line (float)
yInt (float): y-intercept of line (float)
Returns: y (price/value)
line_getPrice_fromXy(x, x1, y1, x2, y2)
Get price at X coordinate, given two points on a line
Parameters:
x (int): x coordinate to solve for y (int - bar index)
x1 (int): x coordinate 1 (int - bar index)
y1 (float): y coordinate 1 (float - price/value)
x2 (int): x coordinate 2 (int - bar index)
y2 (float): y coordinate 2 (float - price/value)
Returns: y (price/value)
line_getRtSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
Parameters:
x1 (int): x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float): y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int): x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float): y coordinate 2 (float - optional, required if argument l is not specified)
l (line): 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 (int): x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float): y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int): x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float): y coordinate 2 (float - optional, required if argument l is not specified)
l (line): line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: length of line (float)
line_fromXy(x1, y1, x2, y2)
Get line slope and y-intercept from coordinates
Parameters:
x1 (int): x coordinate 1 (int - bar index)
y1 (float): y coordinate 1 (float - price/value)
x2 (int): x coordinate 2 (int - bar index)
y2 (float): y coordinate 2 (float - price/value)
Returns: [slope, y-intercept] of line
line_getPrice(x, slope, yInt)
Get price at X coordinate, given line slope and y-intercept
Parameters:
x (int): x coordinate to solve for y (int - bar index)
slope (float): slope of line (float)
yInt (float): y-intercept of line (float)
Returns: y (price/value)
line_getPrice_fromXy(x, x1, y1, x2, y2)
Get price at X coordinate, given two points on a line
Parameters:
x (int): x coordinate to solve for y (int - bar index)
x1 (int): x coordinate 1 (int - bar index)
y1 (float): y coordinate 1 (float - price/value)
x2 (int): x coordinate 2 (int - bar index)
y2 (float): y coordinate 2 (float - price/value)
Returns: y (price/value)
line_getRtSides(x1, y1, x2, y2, l)
Get length of sides of a right triangle formed by a given line
Parameters:
x1 (int): x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float): y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int): x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float): y coordinate 2 (float - optional, required if argument l is not specified)
l (line): 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 (int): x coordinate 1 (int - optional, required if argument l is not specified)
y1 (float): y coordinate 1 (float - optional, required if argument l is not specified)
x2 (int): x coordinate 2 (int - optional, required if argument l is not specified)
y2 (float): y coordinate 2 (float - optional, required if argument l is not specified)
l (line): line object (line - optional, required if x1, y1, x2, y2 agruments are not specified)
Returns: length of line (float)
مكتبة باين
كمثال للقيم التي تتبناها TradingView، نشر المؤلف شيفرة باين كمكتبة مفتوحة المصدر بحيث يمكن لمبرمجي باين الآخرين من مجتمعنا استخدامه بحرية. تحياتنا للمؤلف! يمكنك استخدام هذه المكتبة بشكل خاص أو في منشورات أخرى مفتوحة المصدر، ولكن إعادة استخدام هذا الرمز في المنشورات تخضع لقواعد الموقع.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
مكتبة باين
كمثال للقيم التي تتبناها TradingView، نشر المؤلف شيفرة باين كمكتبة مفتوحة المصدر بحيث يمكن لمبرمجي باين الآخرين من مجتمعنا استخدامه بحرية. تحياتنا للمؤلف! يمكنك استخدام هذه المكتبة بشكل خاص أو في منشورات أخرى مفتوحة المصدر، ولكن إعادة استخدام هذا الرمز في المنشورات تخضع لقواعد الموقع.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.