PINE LIBRARY
Mis à jour

NR_Versatilities

312
Library "NR_Versatilities"
Versatilities (aka, Versatile Utilities) includes:
- Seventeen Price Variants returned as a tuple,
- Eight Smoothing functions rolled into one,
- Pick any Past Value from any series with offset,
- Or just the previous value from any series.

pastVal(src, len)
  Fetches past value from src that came len distance ago
  Parameters:
    src (float): source series
    len (int): lookback distance - (optional) default is 1
  Returns: latest src if len <= 0, else src[len]

previous(src)
  Fetches past value from src that came len distance ago
  Parameters:
    src (float): source series
  Returns: previous value in the series if found, else current value

price_variants()
  Computes Several different averages using current and previous OHLC values
  Returns: Seventeen Uncommon Average Price Combinations

dynamic_MA(matyp, masrc, malen, lsmaoff, almasgm, almaoff, almaflr)
  Dynamically computes Eight different MAs on-demand individually, or an average of all taken together
  Parameters:
    matyp (string): pick one of these MAs - ALMA, EMA, HMA, LSMA, RMA, SMA, SWMA, WMA, ALL [= average of all MAs]
    masrc (float): source series to compute MA
    malen (simple int): lookback distance for MA
    lsmaoff (simple int): optional LSMA offset - default is 0
    almasgm (simple float): optional ALMA sigma - default is 5
    almaoff (simple float): optional ALMA offset - default is 0.5
    almaflr (simple bool): optional ALMA floor flag - default is false
  Returns: MA series for chosen type or, an average of all of them, if chosen so
Notes de version
v2

Updated:
pastVal(src, len)
  Fetches past value from src that came len distance ago
  Parameters:
    src (float): source series
    len (int): lookback distance - (optional) default is 1
  Returns: latest src if len <= 0, else src[len] (rounded-to-mintick)

price_variants()
  Computes Several different averages using current and previous OHLC values
  Returns: Map of Eighteen Uncommon Combinations of single and two-bar OHLC averages (rounded-to-mintick)

dynamic_MA(matyp, masrc, malen, lsmaoff, almasgm, almaoff, almaflr)
  Dynamically computes Eight different MAs on-demand individually, or an average of all taken together
  Parameters:
    matyp (string): pick one of these MAs - ALMA, EMA, HMA, LSMA, RMA, SMA, SWMA, WMA, ALL [= average of all MAs]
    masrc (float): source series to compute MA
    malen (simple int): lookback distance for MA
    lsmaoff (simple int): optional LSMA offset - default is 0
    almasgm (simple float): optional ALMA sigma - default is 5
    almaoff (simple float): optional ALMA offset - default is 0.5
    almaflr (simple bool): optional ALMA floor flag - default is false
  Returns: MA series for chosen type or, an average of all of them, if chosen so (rounded-to-mintick)
Notes de version
v3

Updated:
dynamic_MA(masrc, malen, lsmaoff, almasgm, almaoff, almaflr)
  Dynamically computes Eight different MAs and returns a Map containing Nine MAs
  Parameters:
    masrc (float): source series to compute MA
    malen (simple int): lookback distance for MA
    lsmaoff (simple int): optional LSMA offset - default is 0
    almasgm (simple float): optional ALMA sigma - default is 5
    almaoff (simple float): optional ALMA offset - default is 0.5
    almaflr (simple bool): optional ALMA floor flag - default is false
  Returns: Map of MAs - 'ALMA', 'EMA', 'HMA', 'LSMA', 'RMA', 'SMA', 'SWMA', 'WMA', 'ALL' (rounded-to-mintick)

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.