PINE LIBRARY

utils

已更新
Library "utils"
Few essentials captured together (subset of arrayutils)

timer(timeStart, timeEnd)
  finds difference between two timestamps
  Parameters:
    timeStart (int): start timestamp
    timeEnd (int)
  Returns: [days, hours, minutes, seconds, milliseconds]

method check_overflow(pivots, barArray, dir)
  finds difference between two timestamps
  Namespace types: array<float>
  Parameters:
    pivots (array<float>): pivots array
    barArray (array<float>): pivot bar array
    dir (int): direction for which overflow need to be checked
  Returns: bool overflow

method get_trend_series(pivots, length, highLow, trend)
  finds series of pivots in particular trend
  Namespace types: array<float>
  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

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

getConsolidatedLabel(include, labels, separator)
  Consolidates labels into single string by concatenating it with given separator
  Parameters:
    include (array<bool>): array of conditions to include label or not
    labels (array<string>): string array of labels
    separator (string): Separator for concatenating labels
  Returns: string labelText

method getColors(theme)
  gets array of colors based on theme
  Namespace types: series Theme
  Parameters:
    theme (series Theme): dark or light theme
  Returns: color[] themeColors
版本注释
v2

Added:
watermark(content, tblPosition, textColor, transparency, textSize)
  Prints watermark on chart using tables
  Parameters:
    content (string): Content to be printed
    tblPosition (simple string): position of the watermark
    textColor (simple color): Text Color
    transparency (simple int): color transparency of watermark
    textSize (simple string): size of watermark
  Returns: void
arrayscolorshewhomustnotbenamedtimesessionstrendoscope

Pine脚本库

本着真正的TradingView精神,作者将此Pine代码发布为开源脚本库,以便我们社区的其他Pine程序员可以重复使用它。向作者致敬!您可以私下或在其它开源出版物中使用此脚本库,但在出版物中重复使用此代码受网站规则约束。

免责声明