PINE LIBRARY
업데이트됨

KTUtils

236
Library "KTUtils"
Utility functions for technical analysis indicators, trend detection, and volatility confirmation.

MGz(close, length)
  MGz
description Moving average smoother used for signal processing
  Parameters:
    close (float): float Price input (typically close)
    length (int): int Length of smoothing period
  Returns: float Smoothed value

atrConf(length)
  atrConf
description Calculates Average True Range (ATR) for volatility confirmation
  Parameters:
    length (simple int): int Length for ATR calculation
  Returns: float ATR value

f(input)
  f
description Simple Moving Average with fixed length
  Parameters:
    input (float): float Input value
  Returns: float Smoothed average

bcwSMA(s, l, m)
  bcwSMA
description Custom smoothing function with weight multiplier
  Parameters:
    s (float): float Signal value
    l (int): int Length of smoothing
    m (int): int Weighting multiplier
  Returns: float Smoothed output

MGxx(close, length)
  MGxx
description Custom Weighted Moving Average (WMA) variant
  Parameters:
    close (float): float Price input
    length (int): int Period length
  Returns: float MGxx smoothed output

_PerChange(lengthTime)
  _PerChange
description Measures percentage price change over a period and range deviation
  Parameters:
    lengthTime (int): int Period for change measurement
  Returns: tuple<float,float,float> Measured change, high deviation, low deviation

dirmov(len)
  dirmov
description Calculates directional movement components
  Parameters:
    len (simple int): int Lookback period
  Returns: tuple<float,float> Plus and Minus DI values

adx(dilen, adxlen)
  adx
description Calculates Average Directional Index (ADX)
  Parameters:
    dilen (simple int): int Length for DI calculation
    adxlen (simple int): int Length for ADX smoothing
  Returns: float ADX value

trChopAnalysis()
  trChopAnalysis
description Identifies chop and trend phases based on True Range Bollinger Bands
  Returns: tuple<float,bool,bool> TR SMA, chop state, trending state

wtiAnalysis(haclose, close, filterValue)
  wtiAnalysis
description Wave Trend Indicator (WTI) with signal crossover logic
  Parameters:
    haclose (float): float Heikin-Ashi close
    close (float): float Standard close
    filterValue (simple int): int Smoothing length
  Returns: tuple<float,float,bool,bool> WTI lines and direction states

basicTrend(hahigh, halow, close, open, filterValue)
  basicTrend
description Determines trend direction based on HA high/low and close
  Parameters:
    hahigh (float): float Heikin-Ashi high
    halow (float): float Heikin-Ashi low
    close (float): float Standard close
    open (float): float Standard open
    filterValue (simple int): int Smoothing period
  Returns: tuple<bool,bool> Uptrend, downtrend flags

metrics(close, filterValue)
  metrics
description Common market metrics
  Parameters:
    close (float): float Price input
    filterValue (int): int RSI smoothing length
  Returns: tuple<float,float,float,float> VWMA, SMA10, RSI, smoothed RSI

piff(close, trend_change)
  piff
description Price-Informed Forward Forecasting (PIFF) model for trend strength
  Parameters:
    close (float): float Price input
    trend_change (float): float Change in trend
  Returns: tuple<float,float,bool,bool,bool,bool> Percent change, flags for trend direction

getMACD()
  getMACD
description Returns MACD, signal line, and histogram
  Returns: tuple<float,float,float> MACD line, Signal line, Histogram

getStoch()
  getStoch
description Returns K and D lines of Stochastic Oscillator
  Returns: tuple<float,float> K and D lines

getKDJ()
  getKDJ
description KDJ momentum oscillator
  Returns: tuple<float,float,float,float> K, D, J, Average

getBBRatio()
  getBBRatio
description Bollinger Band Ratio (BBR) and signal flags
  Returns: tuple<float,float,float,float,bool,bool> Basis, Upper, Lower, BBR, BBR Up, BBR Down

getSupertrend()
  getSupertrend
description Supertrend values and direction flags
  Returns: tuple<float,int,bool,bool> Supertrend, Direction, Up, Down
릴리즈 노트
v2

Added:
getPivots(filterValue)
  getPivots
description Calculates pivot highs and lows for swing detection
  Parameters:
    filterValue (int): int Lookback/lookahead length for pivot detection
  Returns: tuple<float,float> Pivot high, Pivot low (na when no pivot detected)

emaEma(source, length)
  emaEma
description Double EMA smoothing (EMA of EMA)
  Parameters:
    source (float): float Input source
    length (simple int): int EMA length
  Returns: float Double-smoothed EMA value

getSMI(lengthK, lengthD, lengthEMA)
  getSMI
description Stochastic Momentum Index with signal line
  Parameters:
    lengthK (int): int %K length for highest/lowest calculation
    lengthD (simple int): int %D length for EMA smoothing
    lengthEMA (simple int): int Signal line EMA length
  Returns: tuple<float,float,bool,bool> SMI value, SMI signal line, bullish flag, bearish flag

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.