PINE LIBRARY

Common Functions

업데이트됨
Library "CommonFunctions"
This Library provides some handy functions commonly used in Pine Script.

crosses(source1, offset1, source2, offset2) Checks the existance of crosses between the series
  Parameters:
    source1: First series
    offset1: (Optional) Offset of First series. By default 0
    source2: (Optional) Second series. By default 'close' price
    offset2: (Optional) Offset of Second series. By default 0
  Returns: [cross, crossOver, crossUnder]

marketState(source1, offset1, source2, offset2) Determines Bullish/Bearish state according to the relative position between the series.
  Parameters:
    source1: Active series used to determine bullish/bearish states.
    offset1: (Optional) Offset of First series. By default 0.
    source2: (Optional) Second series. By default 'close' price.
    offset2: (Optional) Offset of Second series. By default 0.
  Returns: [bullish, bearish]

histProfile(source) Histogram profiling
  Parameters:
    source: Histogram series
  Returns: [histPosUp, histPosDown, histNegUp, histNegDown]

srcSelect(showSrc1, src1, showSrc2, src2) Selects the appropiate source. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1: Boolean controlling the activation of Source #1.
    src1: Source #1.
    showSrc2: Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2: Sources #2-10. By default 'number'.
  Returns: Selected source.
릴리즈 노트
v2

Updated:
histProfile(hist, ref) Histogram profiling
  Parameters:
    hist: Histogram series
    ref: Reference value. By default '0'
  Returns: [histPosUp, histPosDown, histNegUp, histNegDown]
릴리즈 노트
v3

Added:
floatSelect(showSrc1, src1, showSrc2, src2) Selects the appropiate float variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1: Boolean controlling the activation of Source #1.
    src1: Source #1.
    showSrc2: Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2: Sources #2-10. By default 'number'.
  Returns: Selected source.

intSelect(showSrc1, src1, showSrc2, src2) Selects the appropiate integer variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1: Boolean controlling the activation of Source #1.
    src1: Source #1.
    showSrc2: Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2: Sources #2-10. By default 'number'.
  Returns: Selected source.

boolSelect(showSrc1, src1, showSrc2, src2) Selects the appropiate bool variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1: Boolean controlling the activation of Source #1.
    src1: Source #1.
    showSrc2: Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2: Sources #2-10. By default 'false'.
  Returns: Selected source.

Removed:
srcSelect(showSrc1, src1, showSrc2, src2) Selects the appropiate source based on a boolean variable. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
릴리즈 노트
v4

Added:
colorSelect(showSrc1, src1, showSrc2, src2, showSrc3, src3, showSrc4, src4, showSrc5, src5, showSrc6, src6, showSrc7, src7, showSrc8, src8, showSrc9, src9, showSrc10, src10)
  Selects the appropiate color variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1 (simple bool): Boolean controlling the activation of Source #1.
    src1 (color): Source #1.
    showSrc2 (simple bool): Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2 (color): Sources #2-10. By default 'false'.
    showSrc3 (simple bool)
    src3 (color)
    showSrc4 (simple bool)
    src4 (color)
    showSrc5 (simple bool)
    src5 (color)
    showSrc6 (simple bool)
    src6 (color)
    showSrc7 (simple bool)
    src7 (color)
    showSrc8 (simple bool)
    src8 (color)
    showSrc9 (simple bool)
    src9 (color)
    showSrc10 (simple bool)
    src10 (color)
  Returns: Selected source.
릴리즈 노트
v5

Updated:
crosses(source1, offset1, source2, offset2)
  Checks the existance of crosses between the series
  Parameters:
    source1 (float): First series
    offset1 (int): (Optional) Offset of First series. By default 0
    source2 (float): (Optional) Second series. By default 'close' price
    offset2 (int): (Optional) Offset of Second series. By default 0
  Returns: [cross, crossOver, crossUnder]

marketState(source1, offset1, source2, offset2)
  Determines Bullish/Bearish state according to the relative position between the series.
  Parameters:
    source1 (float): Active used to determine bullish/bearish states.
    offset1 (int): (Optional) Offset of First series. By default 0.
    source2 (float): (Optional) Second series. By default 'close' price.
    offset2 (int): (Optional) Offset of Second series. By default 0.
  Returns: [bullish, bearish]

floatSelect(showSrc1, src1, showSrc2, src2, showSrc3, src3, showSrc4, src4, showSrc5, src5, showSrc6, src6, showSrc7, src7, showSrc8, src8, showSrc9, src9, showSrc10, src10)
  Selects the appropiate float variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1 (bool): Boolean controlling the activation of Source #1.
    src1 (float): Source #1.
    showSrc2 (bool): Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2 (float): Sources #2-10. By default 'number'.
    showSrc3 (bool)
    src3 (float)
    showSrc4 (bool)
    src4 (float)
    showSrc5 (bool)
    src5 (float)
    showSrc6 (bool)
    src6 (float)
    showSrc7 (bool)
    src7 (float)
    showSrc8 (bool)
    src8 (float)
    showSrc9 (bool)
    src9 (float)
    showSrc10 (bool)
    src10 (float)
  Returns: Selected source.

intSelect(showSrc1, src1, showSrc2, src2, showSrc3, src3, showSrc4, src4, showSrc5, src5, showSrc6, src6, showSrc7, src7, showSrc8, src8, showSrc9, src9, showSrc10, src10)
  Selects the appropiate integer variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1 (bool): Boolean controlling the activation of Source #1.
    src1 (int): Source #1.
    showSrc2 (bool): Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2 (int): Sources #2-10. By default 'number'.
    showSrc3 (bool)
    src3 (int)
    showSrc4 (bool)
    src4 (int)
    showSrc5 (bool)
    src5 (int)
    showSrc6 (bool)
    src6 (int)
    showSrc7 (bool)
    src7 (int)
    showSrc8 (bool)
    src8 (int)
    showSrc9 (bool)
    src9 (int)
    showSrc10 (bool)
    src10 (int)
  Returns: Selected source.

boolSelect(showSrc1, src1, showSrc2, src2, showSrc3, src3, showSrc4, src4, showSrc5, src5, showSrc6, src6, showSrc7, src7, showSrc8, src8, showSrc9, src9, showSrc10, src10)
  Selects the appropiate bool variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1 (bool): Boolean controlling the activation of Source #1.
    src1 (bool): Source #1.
    showSrc2 (bool): Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2 (bool): Sources #2-10. By default 'false'.
    showSrc3 (bool)
    src3 (bool)
    showSrc4 (bool)
    src4 (bool)
    showSrc5 (bool)
    src5 (bool)
    showSrc6 (bool)
    src6 (bool)
    showSrc7 (bool)
    src7 (bool)
    showSrc8 (bool)
    src8 (bool)
    showSrc9 (bool)
    src9 (bool)
    showSrc10 (bool)
    src10 (bool)
  Returns: Selected source.

colorSelect(showSrc1, src1, showSrc2, src2, showSrc3, src3, showSrc4, src4, showSrc5, src5, showSrc6, src6, showSrc7, src7, showSrc8, src8, showSrc9, src9, showSrc10, src10)
  Selects the appropiate color variable based on a boolean condition. If multiple sources are activated simultaneously, the order within the switch clause prevails. The first one activated is the one being output.
  Parameters:
    showSrc1 (bool): Boolean controlling the activation of Source #1.
    src1 (color): Source #1.
    showSrc2 (bool): Boolean controlling the activation of Sources #2-10. By default 'false'.
    src2 (color): Sources #2-10. By default 'false'.
    showSrc3 (bool)
    src3 (color)
    showSrc4 (bool)
    src4 (color)
    showSrc5 (bool)
    src5 (color)
    showSrc6 (bool)
    src6 (color)
    showSrc7 (bool)
    src7 (color)
    showSrc8 (bool)
    src8 (color)
    showSrc9 (bool)
    src9 (color)
    showSrc10 (bool)
    src10 (color)
  Returns: Selected source.
techindicator

파인 라이브러리

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


I develop indicators meant to be useful, profitable and good looking.

면책사항