PINE LIBRARY
更新済

TraderMath

210
Library "TraderMath"
A collection of essential trading utilities and mathematical functions used for technical analysis,
including DEMA, Fisher Transform, directional movement, and ADX calculations.

dema(source, length)
  Calculates the value of the Double Exponential Moving Average (DEMA).
  Parameters:
    source (float): (series int/float) Series of values to process.
    length (simple int): (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The double exponentially weighted moving average of the `source`.

roundVal(val)
  Constrains a value to the range [-0.999, 0.999].
  Parameters:
    val (float): (float) Value to constrain.
  Returns: (float) Value limited to the range [-0.999, 0.999].

fisherTransform(length)
  Computes the Fisher Transform oscillator, enhancing turning point sensitivity.
  Parameters:
    length (int): (int) Lookback length used to normalize price within the high-low range.
  Returns: (float) Fisher Transform value.

dirmov(len)
  Calculates the Plus and Minus Directional Movement components (DI+ and DI−).
  Parameters:
    len (simple int): (int) Lookback length for directional movement.
  Returns: (float[2]) Array containing [plusDI, minusDI].

adx(dilen, adxlen)
  Computes the Average Directional Index (ADX) based on DI+ and DI−.
  Parameters:
    dilen (simple int): (int) Lookback length for directional movement calculation.
    adxlen (simple int): (int) Smoothing length for ADX computation.
  Returns: (float) Average Directional Index value (0–100).
リリースノート
v2

Added:
getLiquiditySignals(length)
  Detects liquidity sweeps and Market Structure Shifts (MSS).
  Parameters:
    length (int): (int) Lookback window used to determine prior swing extremes.
The function compares current highs/lows to the highest/lowest
values within this lookback (excluding the current bar) to identify
liquidity grabs.
  Returns: (bool mssUp, bool mssDown)
mssUp → True when a downside liquidity sweep occurs and price
closes higher than the previous bar, indicating potential
bullish structure shift.
mssDown → True when an upside liquidity sweep occurs and price
closes lower than the previous bar, indicating potential
bearish structure shift.

minifyJson(json)
  Removes unnecessary whitespace from a JSON string to produce a compact,
single-line payload suitable for webhook transmission.
  Parameters:
    json (string): (string) Raw JSON text, potentially containing spaces, indentation,
and newline characters.
  Returns: (string) Minified JSON string with all spaces and line breaks removed.

免責事項

この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。