PINE LIBRARY

arrayutils

20
Library "arrayutils"

delete(arr, index)
  remove an item from array at specific index. Also deletes the item
  Parameters:
    arr (array<line>): - array from which the item needs to be deleted
    index (int): - index of item to be deleted
  Returns: void

delete(arr, index)
  Parameters:
    arr (array<label>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<box>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<table>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<linefill>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<int>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<float>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<bool>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<string>)
    index (int)

delete(arr, index)
  Parameters:
    arr (array<color>)
    index (int)

pop(arr)
  remove the last item from array. Also deletes the item
  Parameters:
    arr (array<line>): - array from which the last item needs to be removed and deleted
  Returns: void

pop(arr)
  Parameters:
    arr (array<label>)

pop(arr)
  Parameters:
    arr (array<box>)

pop(arr)
  Parameters:
    arr (array<table>)

pop(arr)
  Parameters:
    arr (array<linefill>)

pop(arr)
  Parameters:
    arr (array<int>)

pop(arr)
  Parameters:
    arr (array<float>)

pop(arr)
  Parameters:
    arr (array<bool>)

pop(arr)
  Parameters:
    arr (array<string>)

pop(arr)
  Parameters:
    arr (array<color>)

shift(arr)
  remove an item from array at index 0. Also deletes the item
  Parameters:
    arr (array<line>): - array from which the first item needs to be removed and deleted
  Returns: void

shift(arr)
  Parameters:
    arr (array<label>)

shift(arr)
  Parameters:
    arr (array<box>)

shift(arr)
  Parameters:
    arr (array<table>)

shift(arr)
  Parameters:
    arr (array<linefill>)

shift(arr)
  Parameters:
    arr (array<int>)

shift(arr)
  Parameters:
    arr (array<float>)

shift(arr)
  Parameters:
    arr (array<bool>)

shift(arr)
  Parameters:
    arr (array<string>)

shift(arr)
  Parameters:
    arr (array<color>)

unshift(arr, val, maxItems)
  add an item to the beginning of an array with max items cap
  Parameters:
    arr (array<int>): - array to which the item needs to be added at the beginning
    val (int): - value of item which needs to be added
    maxItems (simple int): - max items array can hold. After that, items are removed from the other end
  Returns: resulting array

unshift(arr, val, maxItems)
  Parameters:
    arr (array<float>)
    val (float)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<bool>)
    val (bool)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<string>)
    val (string)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<color>)
    val (color)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<line>)
    val (line)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<label>)
    val (label)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<box>)
    val (box)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<table>)
    val (table)
    maxItems (simple int)

unshift(arr, val, maxItems)
  Parameters:
    arr (array<linefill>)
    val (linefill)
    maxItems (simple int)

clear(arr)
  remove and delete all items in an array
  Parameters:
    arr (array<line>): - array which needs to be cleared
  Returns: void

clear(arr)
  Parameters:
    arr (array<label>)

clear(arr)
  Parameters:
    arr (array<box>)

clear(arr)
  Parameters:
    arr (array<table>)

clear(arr)
  Parameters:
    arr (array<linefill>)

clear(arr)
  Parameters:
    arr (array<int>)

clear(arr)
  Parameters:
    arr (array<float>)

clear(arr)
  Parameters:
    arr (array<bool>)

clear(arr)
  Parameters:
    arr (array<string>)

clear(arr)
  Parameters:
    arr (array<color>)

push(arr, val, maxItems)
  add an item to the end of an array with max items cap
  Parameters:
    arr (array<int>): - array to which the item needs to be added at the beginning
    val (int): - value of item which needs to be added
    maxItems (simple int): - max items array can hold. After that, items are removed from the starting index
  Returns: resulting array

push(arr, val, maxItems)
  Parameters:
    arr (array<float>)
    val (float)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<bool>)
    val (bool)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<string>)
    val (string)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<color>)
    val (color)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<line>)
    val (line)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<label>)
    val (label)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<box>)
    val (box)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<table>)
    val (table)
    maxItems (simple int)

push(arr, val, maxItems)
  Parameters:
    arr (array<linefill>)
    val (linefill)
    maxItems (simple int)

check_overflow(a, b, c, pivots, barArray)
  finds difference between two timestamps
  Parameters:
    a (float)
    b (float)
    c (float)
    pivots (array<float>): pivots array
    barArray (array<int>): pivot bar array
  Returns: bool overflow

get_trend_series(pivots, length, highLow, trend)
  finds series of pivots in particular trend
  Parameters:
    pivots (array<float>): pivots array
    length (int): length for which trend series need to be checked
    highLow (int): filter pivot high or low
    trend (int): Uptrend or Downtrend
  Returns: int[] trendIndexes

get_trend_series(pivots, firstIndex, lastIndex)
  finds series of pivots in particular trend
  Parameters:
    pivots (array<float>): pivots array
    firstIndex (int): First index of the series
    lastIndex (int): Last index of the series
  Returns: int[] trendIndexes

sma(source)
  calculates sma for elements in array
  Parameters:
    source (array<float>): source array
  Returns: float sma

ema(source, length)
  calculates ema for elements in array
  Parameters:
    source (array<float>): source array
    length (simple int): ema length
  Returns: float ema

rma(source, length)
  calculates rma for elements in array
  Parameters:
    source (array<float>): source array
    length (simple int): rma length
  Returns: float rma

wma(source, length)
  calculates wma for elements in array
  Parameters:
    source (array<float>): source array
    length (simple int): wma length
  Returns: float wma

hma(source, length)
  calculates hma for elements in array
  Parameters:
    source (array<float>): source array
    length (simple int): hma length
  Returns: float hma

ma(source, matype, length)
  wrapper for all moving averages based on array
  Parameters:
    source (array<float>): source array
    matype (simple string): moving average type. Valud values are: sma, ema, rma, wma, hma, high, low, median, medianHigh, medianLow
    length (simple int): moving average length length
  Returns: float moving average

getFibSeries(numberOfFibs, start)
  gets fib series in array
  Parameters:
    numberOfFibs (simple int): number of fibs
    start (simple int): starting number
  Returns: float[] fibArray

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.