TradFi Fundamentals: Enhanced Macroeconomic Momentum Trading Introduction
The "Enhanced Momentum with Advanced Normalization and Smoothing" indicator is a tool that combines traditional price momentum with a broad range of macroeconomic factors. I introduced the basic version from a research paper in my last script. This one leverages not only the price action of a security but also incorporates key economic data—such as GDP, inflation, unemployment, interest rates, consumer confidence, industrial production, and market volatility (VIX)—to create a comprehensive, normalized momentum score.
Previous indicator
Explanation
In plain terms, the indicator calculates a raw momentum value based on the change in price over a defined lookback period. It then normalizes this momentum, along with several economic indicators, using a method chosen by the user (options include simple, exponential, or weighted moving averages, as well as a median absolute deviation (MAD) approach). Each normalized component is assigned a weight reflecting its relative importance, and these weighted values are summed to produce an overall momentum score.
To reduce noise, the combined momentum score can be further smoothed using a user-selected method.
Signals
For generating trade signals, the indicator offers two modes:
Zero Cross Mode: Signals occur when the smoothed momentum line crosses the zero threshold.
Zone Mode: Overbought and oversold boundaries (which are user defined) provide signals when the momentum line crosses these preset limits.
Definition of the Settings
Price Momentum Settings:
Price Momentum Lookback: The number of days used to compute the percentage change in price (default 50 days).
Normalization Period (Price Momentum): The period over which the price momentum is normalized (default 200 days).
Economic Data Settings:
Normalization Period (Economic Data): The period used to normalize all economic indicators (default 200 days).
Normalization Method: Choose among SMA, EMA, WMA, or MAD to standardize both price and economic data. If MAD is chosen, a multiplier factor is applied (default is 1.4826).
Smoothing Options:
Apply Smoothing: A toggle to enable further smoothing of the combined momentum score.
Smoothing Period & Method: Define the period and type (SMA, EMA, or WMA) used to smooth the final momentum score.
Signal Generation Settings:
Signal Mode: Select whether signals are based on a zero-line crossover or by crossing user-defined overbought/oversold (OB/OS) zones.
OB/OS Zones: Define the upper and lower boundaries (default upper zones at 1.0 and 2.0, lower zones at -1.0 and -2.0) for zone-based signals.
Weights:
Each component (price momentum, GDP, inflation, unemployment, interest rates, consumer confidence, industrial production, and VIX) has an associated weight that determines its contribution to the overall score. These can be adjusted to reflect different market views or risk preferences.
Visual Aspects
The indicator plots the smoothed combined momentum score as a continuous blue line against a dotted zero-line reference. If the Zone signal mode is selected, the indicator also displays the upper and lower OB/OS boundaries as horizontal lines (red for overbought and green for oversold). Buy and sell signals are marked by small labels ("B" for buy and "S" for sell) that appear at the bottom or top of the chart when the score crosses the defined thresholds, allowing traders to quickly identify potential entry or exit points.
Conclusion
This enhanced indicator provides traders with a robust approach to momentum trading by integrating traditional price-based signals with a suite of macroeconomic indicators. Its normalization and smoothing techniques help reduce noise and mitigate the effects of outliers, while the flexible signal generation modes offer multiple ways to interpret market conditions. Overall, this tool is designed to deliver a more nuanced perspective on market momentum.
Tradfi
TradFi Fundamentals: Momentum Trading with Macroeconomic DataIntroduction
This indicator combines traditional price momentum with key macroeconomic data. By retrieving GDP, inflation, unemployment, and interest rates using security calls, the script automatically adapts to the latest economic data. The goal is to blend technical analysis with fundamental insights to generate a more robust momentum signal.
Original Research Paper by Mohit Apte, B. Tech Scholar, Department of Computer Science and Engineering, COEP Technological University, Pune, India
Link to paper
Explanation
Price Momentum Calculation:
The indicator computes price momentum as the percentage change in price over a configurable lookback period (default is 50 days). This raw momentum is then normalized using a rolling simple moving average and standard deviation over a defined period (default 200 days) to ensure comparability with the economic indicators.
Fetching and Normalizing Economic Data:
Instead of manually inputting economic values, the script uses TradingView’s security function to retrieve:
GDP from ticker "GDP"
Inflation (CPI) from ticker "USCCPI"
Unemployment rate from ticker "UNRATE"
Interest rates from ticker "USINTR"
Each series is normalized over a configurable normalization period (default 200 days) by subtracting its moving average and dividing by its standard deviation. This standardization converts each economic indicator into a z-score for direct integration into the momentum score.
Combined Momentum Score:
The normalized price momentum and economic indicators are each multiplied by user-defined weights (default: 50% price momentum, 20% GDP, and 10% each for inflation, unemployment, and interest rates). The weighted components are then summed to form a comprehensive momentum score. A horizontal zero line is plotted for reference.
Trading Signals:
Buy signals are generated when the combined momentum score crosses above zero, and sell signals occur when it crosses below zero. Visual markers are added to the chart to assist with trade timing, and alert conditions are provided for automated notifications.
Settings
Price Momentum Lookback: Defines the period (in days) used to compute the raw price momentum.
Normalization Period for Price Momentum: Sets the window over which the price momentum is normalized.
Normalization Period for Economic Data: Sets the window over which each macroeconomic series is normalized.
Weights: Adjust the influence of each component (price momentum, GDP, inflation, unemployment, and interest rate) on the overall momentum score.
Conclusion
This implementation leverages TradingView’s economic data feeds to integrate real-time macroeconomic data into a momentum trading strategy. By normalizing and weighting both technical and economic inputs, the indicator offers traders a more holistic view of market conditions. The enhanced momentum signal provides additional context to traditional momentum analysis, potentially leading to more informed trading decisions and improved risk management.
The next script I release will be an improved version of this that I have added my own flavor to, improving the signals.