Electrified

Points

Electrified 已更新   
Library "Points"
Provides functions for simplifying operations with collections of x+y coordinates. Where x is typically a bar index or time (millisecond) value.

new(size) Creates two arrays. One for X (int) and another for Y (float).
  Parameters:
    size: The initial size of the arrays.

size(xA, yA) Checks the size of the arrays and if they're equal returns the size.
  Parameters:
    xA: The X array.
    yA: The Y array.

get(xA, yA, index) Gets the X and Y values of the arrays at the index.
  Parameters:
    xA: The X array.
    yA: The Y array.
    index: The index.
  Returns:

set(xA, yA, index, x, y) Sets the X and Y values of the arrays at the index.
  Parameters:
    xA: The X array.
    yA: The Y array.
    index: The index.
    x: The x value.
    y: The y value.
  Returns:

push(xA, yA, x, y) Adds X and Y values to the end of the arrays (as the last element).
  Parameters:
    xA: The X array.
    yA: The Y array.
    x: The x value.
    y: The y value.
  Returns:

unshift(xA, yA, x, y) Adds X and Y values to the beginning of the arrays (as the first element).
  Parameters:
    xA: The X array.
    yA: The Y array.
    x: The x value.
    y: The y value.
  Returns:

insert(xA, yA, index, x, y) Inserts X and Y values to the arrays at the index.
  Parameters:
    xA: The X array.
    yA: The Y array.
    index: The index to insert at.
    x: The x value.
    y: The y value.
  Returns:

pop(xA, yA) Removes the last element from the arrays and returns their value.
  Parameters:
    xA: The X array.
    yA: The Y array.
  Returns:

shift(xA, yA) Removes the first element from the arrays and returns their value.
  Parameters:
    xA: The X array.
    yA: The Y array.
  Returns:

remove(xA, yA) Removes the element from the arrays at the index and returns their value.
  Parameters:
    xA: The X array.
    yA: The Y array.
  Returns:

first(xA, yA) Gets the X and Y values of the first element.
  Parameters:
    xA: The X array.
    yA: The Y array.
  Returns:

last(xA, yA) Gets the X and Y values of the last element.
  Parameters:
    xA: The X array.
    yA: The Y array.
  Returns:

allIndexesBetween(xA, lo, hi, start, ordered) Gets the indexes that have values at or above the low value and below the high value.
  Parameters:
    xA: The X array.
    lo: The inclusive low value.
    hi: The excluded hi value.
    start: The optional index to start the backwards search.
    ordered: If true, the search ends when the first value is found that is less than the low.

lastIndexBetween(xA, lo, hi, start, ordered) Gets the first found from the end that has a value at or above the low value and below the high value.
  Parameters:
    xA: The X array.
    lo: The inclusive low value.
    hi: The excluded hi value.
    start: The optional index to start the backwards search.
    ordered: If true, the search ends when the first value is found that is less than the low.

lastIndexBelow(xA, hi, start) Gets the first found from the end that has a value below the high value.
  Parameters:
    xA: The X array.
    hi: The excluded hi value.
    start: The optional index to start the backwards search.
發布通知:
v2 Updated thumbnail.
發布通知:
v3 Updated thumbnail.
發布通知:
v4 Updated thumbnail.
發布通知:
v5 Added 'add' method for automatically inserting by X value.

Added:
add(xA, yA, x, y) Inserts the X and Y values into the arrays based upon the X value assuming the the arrays is ordered by X.
  Parameters:
    xA: The X array.
    yA: The Y array.
    x: The x value.
    y: The y value.
  Returns:
發布通知:
v6 fixed issue with non-short-circut logic.
Pine腳本庫

本著真正的TradingView精神,作者將此Pine代碼以開源腳本庫發布,以便我們社群的其他Pine程式設計師可以重用它。向作者致敬!您可以私下或在其他開源出版物中使用此庫,但在出版物中重用此代碼受網站規則約束。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想使用這個腳本庫嗎?

複製以下行並將其黏貼到您的腳本中。