PINE LIBRARY
TraderMath

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).
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).
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.