LucF

ta

LucF 업데이트됨   
Library "ta"
This library is a Pine Script™ programmer’s tool containing calcs for my oscillators and some helper functions.

buoyancy(src, targetPeriod, maxLookback)
  Calculates buoyancy using a target of `src` summed over `targetPeriod` bars, not searching back farther than `maxLookback` bars. See:   Parameters:
    src: (series float) The source value that is summed to constitute the target.
    targetPeriod: (series int) The qty of bars to sum `src` for in order to calculate the target.
    maxLookback: (simple int) The maximum number of bars back the function will search.
  Returns: (series float) Buoyancy: the gap between the avg distance of past up and dn bars added to reach the target, divided by the max distance reached. Returns zero when an error condition occurs.

efficientWork(length)
  Calculates Efficient Work on `length` bars. See:   Parameters:
    length: (simple int) The length of the ALMA used to calculate the result.
  Returns: (series float) A -1 to +1 value representing the efficiency of price travel, bar to bar.

ma(type, src, length)
  Returns the `type` MA of the `src` over the `length`.
  Parameters:
    type: (simple string) The type of MA required (uses constants that must be defined earlier in the script).
    src: (series float) The source value used to calculate the MA.
    length: (simple int) The length value used to calculate the MA.
  Returns: (series float) The MA value.

divergenceChannel(divergence, hiSrc, loSrc, breachHiSrc, breachLoSrc)
  Calculates the levels and states of divergence channels, which are created when divergences occur.
  Parameters:
    divergence: (series bool) `true` on divergences, which can be defined any way. On breached channels it creates a new channel, otherwise, channel levels are expanded.
    hiSrc: (series float) The price source used to set the channel's hi level when a divergence occurs.
    loSrc: (series float) The price source used to set the channel's lo level when a divergence occurs.
    breachHiSrc: (series float) The price source that must breach over the channel's `channelHi` level for a breach to occur.
    breachLoSrc: (series float) The price source that must breach under the channel's `channelLo` level for a breach to occur.
  Returns: A tuple containing the following values:


sourceStrToFloat(srcString)
  Converts the name of a source in the `srcString` to its numerical equivalent.
  Parameters:
    srcString: (series string) The string representing the name of the source value to be returned.
  Returns: (series float) The source's value.
릴리즈 노트:
v2

Added:
sott()
  Calculates an instant value for Signs of the Times, a directional measure of bar strength.
  Returns: (series float) SOTT: a value between -1 and +1.
릴리즈 노트:
v3

Added:
zeroOne(cond)
  Converts a "bool" cond to 1 when it is `true`, 0 when it's false.
  Parameters:
    cond (bool): (bool) The "bool" value to be converted.
  Returns: (int) 1 when `cond` is `true`, `false` otherwise.

addTextIf(cond, msg, txt, sep)
  Appends `sep` and `txt` to `msg` when `cond` is true.
  Parameters:
    cond (bool): (bool) The condition determining if text will be added.
    msg (string): (string) The string to which we add text.
    txt (string): (string) The text to be added.
    sep (string): (string) A separator string to be added before `txt` when `msg` already contains text.
  Returns: (int) The modified `msg` string if `cond` is `true`. Returns `msg` unchanged if `cond` is `false`.

gradientAdvDecPro(source, center, steps, bearWeakColor, bearStrongColor, bullWeakColor, bullStrongColor)
  Calculates a gradient between two bull or two bear colors, depending on whether the source signal is above/below the centerline.
The gradient is proportional to the current qty of advances/declines of the `source`.
The count of advances/declines resets to one when the `source` crosses the `center` and is limited by `steps`.
  Parameters:
    source (float): (float) input signal.
    center (float): (float) (- ∞ to ∞) centerline used to determine if signal is bullish/bearish.
    steps (float): (float) Maximum number of steps in the gradient from the weak color to the strong color.
    bearWeakColor (color): (color) bear color at adv/dec qty of 1.
    bearStrongColor (color): (color) bear color at adv/dec qty of `steps`.
    bullWeakColor (color): (color) bull color at adv/dec qty of 1.
    bullStrongColor (color): (color) bull color at adv/dec qty of `steps`.
  Returns: (color) The calculated color.

upDnIntrabarVolumesByPolarity()
  Determines if the volume for an intrabar is up or down.
  Returns: () A tuple of two values, one of which contains the bar's volume. `upVol` is the positive volume of up bars. `dnVol` is the negative volume of down bars.
Note that when this function is designed to be called with `request.security_lower_tf()`,
which will return a tuple of "array" arrays containing up and dn volume for all the intrabars in a chart bar.

"The stock market is a device for transferring money from the impatient to the patient."
— Buffet

www.tradingview.com/u/PineCoders/
www.tradingview.com/u/TradingView/
파인 라이브러리

트레이딩뷰 정신에 따라 오써는 이 파인 코드를 오픈 소스 라이브러리로 퍼블리쉬하여 당사 커뮤니티의 다른 파인 프로그래머들이 쓸 수 있도록 하였습니다. 오써에게 찬사를! 여러분은 이 라이브러리를 프라이빗 또는 오픈 소스 퍼블리케이션에 쓸 수 있지만 퍼블리케이션에 재사용은 하우스룰을 따릅니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

이 라이브러리를 쓰시겠습니까?

텍스트를 클립보드에 카피한 뒤 님의 스크립트에 붙여 넣기.