PINE LIBRARY

MarcosLibrary

Library "MarcosLibrary"
A colection of frequently used functions in my scripts.

bullFibRet(priceLow, priceHigh, fibLevel)
  Calculates a bullish fibonacci retracement value.
  Parameters:
    priceLow (float): (float) The lowest price point.
    priceHigh (float): (float) The highest price point.
    fibLevel (float): (float) The fibonacci level to calculate.
  Returns: The fibonacci value of the given retracement level.

bearFibRet(priceLow, priceHigh, fibLevel)
  Calculates a bearish fibonacci retracement value.
  Parameters:
    priceLow (float): (float) The lowest price point.
    priceHigh (float): (float) The highest price point.
    fibLevel (float): (float) The fibonacci level to calculate.
  Returns: The fibonacci value of the given retracement level.

bullFibExt(priceLow, priceHigh, thirdPivot, fibLevel)
  Calculates a bullish fibonacci extension value.
  Parameters:
    priceLow (float): (float) The lowest price point.
    priceHigh (float): (float) The highest price point.
    thirdPivot (float): (float) The third price point.
    fibLevel (float): (float) The fibonacci level to calculate.
  Returns: The fibonacci value of the given extension level.

bearFibExt(priceLow, priceHigh, thirdPivot, fibLevel)
  Calculates a bearish fibonacci extension value.
  Parameters:
    priceLow (float): (float) The lowest price point.
    priceHigh (float): (float) The highest price point.
    thirdPivot (float): (float) The third price point.
    fibLevel (float): (float) The fibonacci level to calculate.
  Returns: The fibonacci value of the given extension level.

isBullish(barsBack)
  Checks if a specific bar is bullish.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar is bullish, otherwise returns false.

isBearish(barsBack)
  Checks if a specific bar is bearish.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar is bearish, otherwise returns false.

isBE(barsBack)
  Checks if a specific bar is break even.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar is break even, otherwise returns false.

getBodySize(barsBack, inPriceChg)
  Calculates a specific candle's body size.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
    inPriceChg (bool): (bool) True to return the body size as a price change value. The default is false (in points).
  Returns: The candle's body size in points.

getTopWickSize(barsBack, inPriceChg)
  Calculates a specific candle's top wick size.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
    inPriceChg (bool): (bool) True to return the wick size as a price change value. The default is false (in points).
  Returns: The candle's top wick size in points.

getBottomWickSize(barsBack, inPriceChg)
  Calculates a specific candle's bottom wick size.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
    inPriceChg (bool): (bool) True to return the wick size as a price change value. The default is false (in points).
  Returns: The candle's bottom wick size in points.

getBodyPercent(barsBack)
  Calculates a specific candle's body size as a percentage of its entire size including its wicks.
  Parameters:
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: The candle's body size percentage.

isHammer(fib, bullish, barsBack)
  Checks if a specific bar is a hammer candle based on a given fibonacci level.
  Parameters:
    fib (float): (float) The fibonacci level to base candle's body on. The default is 0.382.
    bullish (bool): (bool) True if the candle must to be green. The default is false.
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar matches the requirements of a hammer candle, otherwise returns false.

isShootingStar(fib, bearish, barsBack)
  Checks if a specific bar is a shooting star candle based on a given fibonacci level.
  Parameters:
    fib (float): (float) The fibonacci level to base candle's body on. The default is 0.382.
    bearish (bool): (bool) True if the candle must to be red. The default is false.
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar matches the requirements of a shooting star candle, otherwise returns false.

isDoji(wickSize, bodySize, barsBack)
  Checks if a specific bar is a doji candle based on a given wick and body size.
  Parameters:
    wickSize (float): (float) The maximum top wick size compared to the bottom and vice versa. The default is 1.5.
    bodySize (float): (bool) The maximum body size as a percentage compared to the entire candle size. The default is 5.
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar matches the requirements of a doji candle.

isBullishEC(gapTolerance, rejectionWickSize, engulfWick, barsBack)
  Checks if a specific bar is a bullish engulfing candle.
  Parameters:
    gapTolerance (int)
    rejectionWickSize (int): (int) The maximum top wick size compared to the body as a percentage. The default is 10.
    engulfWick (bool): (bool) True if the engulfed candle's wick requires to be engulfed as well. The default is false.
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar matches the requirements of a bullish engulfing candle.

isBearishEC(gapTolerance, rejectionWickSize, engulfWick, barsBack)
  Checks if a specific bar is a bearish engulfing candle.
  Parameters:
    gapTolerance (int)
    rejectionWickSize (int): (int) The maximum bottom wick size compared to the body as a percentage. The default is 10.
    engulfWick (bool): (bool) True if the engulfed candle's wick requires to be engulfed as well. The default is false.
    barsBack (int): (int) The number of bars to look back. The default is 0 (current bar).
  Returns: True if the bar matches the requirements of a bearish engulfing candle.
bar_typesMarket Geometrytechindicator

파인 라이브러리

진정한 TradingView 정신에 따라, 저자는 이 파인 코드를 다른 파인 프로그래머들이 재사용할 수 있도록 오픈 소스 라이브러리로 공개했습니다. 저자에게 박수를 보냅니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈 소스 출판물에서 사용할 수 있지만, 이 코드를 출판물에서 재사용하는 것은 하우스 룰에 의해 관리됩니다.

면책사항