PINE LIBRARY

InsertionSort

Library "InsertionSort"
Library of sorting algorithm for binary insertion sort and related methods

method binary_insertion_sort(sortedArray, item, order)
  binary insertion sort - inserts item into sorted array while maintaining sort order
  Namespace types: array<float>
  Parameters:
    sortedArray (array<float>): array<float|int> which is assumed to be sorted in the requested order
    item (float): float|int item which needs to be inserted into sorted array
    order (series ORDER): Sort order - positive number means ascending order whereas negative number represents descending order
  Returns: int index at which the item is inserted into sorted array

method binary_insertion_sort(sortedArray, item, order)
  Namespace types: array<int>
  Parameters:
    sortedArray (array<int>)
    item (int)
    order (series ORDER)
arrayshewhomustnotbenamed

Pine腳本庫

在真正的TradingView精神中,作者將這段Pine程式碼發佈為開源程式庫,以便我們社群的其他Pine程式設計師可以重複使用它。請向作者致敬!您可以私下使用這個函式庫,或在其他開源出版品中使用,但在出版物中再次使用這段程式碼將受到網站規則的約束。

免責聲明