PINE LIBRARY

PubLibSwing

Library "PubLibSwing"
swing high and swing low conditions, prices, bar indices and range ratios for indicator and strategy development

sh()
  swing high condition
  Returns: bool

sl()
  swing low condition
  Returns: bool

shbi(occ)
  swing high bar index, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: int

slbi(occ)
  swing low bar index, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: int

shcp(occ)
  swing high close price, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float

slcp(occ)
  swing low close price, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float

shp(occ)
  swing high price, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float

slp(occ)
  swing low price, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float

shpbi(occ)
  swing high price bar index, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: int

slpbi(occ)
  swing low price bar index, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: int

shrr(occ)
  swing high range ratio, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float

slrr(occ)
  swing low range ratio, condition occurrence n
  Parameters:
    occ (simple int)
  Returns: float
statisticsstrategiestechindicator

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer