OPEN-SOURCE SCRIPT

MACD -- Normalized

█ OVERVIEW

This indicator is a normalized and scaled version of the Moving Average Convergence Divergence (MACD) indicator, inspired by the work in "Statistically Sound Indicators" by Timothy Masters. It enhances the traditional MACD by applying statistical normalization and scaling techniques, providing more consistent and reliable signals across different markets and timeframes.

█ CONCEPTS

The traditional MACD measures the difference between two Exponential Moving Averages (EMAs) of different lengths to identify momentum changes. However, its raw values are unbounded, making it challenging to compare across different instruments or timeframes.

This normalized MACD addresses this limitation by:

 • Normalization: Adjusting the MACD values using the Average True Range (ATR) to account for market volatility.
 • Scaling: Applying the Cumulative Distribution Function (CDF) to constrain the output between -50 and +50.
 • Smoothing: Providing a smoothed signal line and histogram to effectively visualize momentum shifts.

█ FEATURES

 • Normalized MACD Line: Computes the difference between the short-term and long-term EMAs, normalized by market volatility.
 • Signal Line: Applies EMA smoothing to the normalized MACD line over a user-defined period.
 • Histogram: Visualizes the difference between the normalized MACD line and the signal line, highlighting momentum changes.
 • Customization Options:
  • Adjustable lengths for the short-term EMA, long-term EMA, and signal line smoothing.
  • Ability to toggle the visibility of the MACD line, signal line, and histogram.
 • Statistical Scaling: Utilizes statistical methods from Timothy Masters' work to provide consistent scaling across different instruments.

█ HOW TO USE

1 — Identify Momentum Shifts:
  • A crossover of the MACD line above the signal line may indicate a bullish momentum shift.
  • A crossover of the MACD line below the signal line may indicate a bearish momentum shift.
2 — Analyze the Histogram:
  • A rising histogram suggests strengthening momentum in the current trend direction.
  • A falling histogram may signal weakening momentum or a potential reversal.
3 — Customize Parameters:
  • Adjust the EMA lengths and smoothing periods to fit the specific instrument or timeframe.
  • Use the visibility toggles to focus on the components most relevant to your analysis.
4 — Combine with Other Tools:
  • Use in conjunction with support/resistance levels, trend lines, or other indicators to confirm signals.
  • Consider the overall market context to enhance decision-making.

█ LIMITATIONS

 • The indicator is based on historical price data; it may not predict future market movements accurately.
 • May produce false signals during low volatility or ranging market conditions.
 • Initial periods may display na values due to insufficient data for calculations.

█ NOTES

 • Ensure that the MathHelpers library by HuntGatherTrade is imported for the indicator to function correctly.
 • The default parameters are commonly used settings but may require adjustments based on the trading instrument and timeframe.
 • The normalization and scaling techniques are designed to make the indicator's outputs more comparable across different markets.

Moving Average Convergence / Divergence (MACD)statistics

Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Хотите использовать этот скрипт на графике?

Отказ от ответственности