OPEN-SOURCE SCRIPT

ADW - Momentum

Updated
ADW - Momentum is a trading indicator based on the Relative Momentum Index (RMI) and Exponential Moving Averages (EMAs). This indicator plots the RMI along with its EMAs and highlights regions where RMI crosses its slow EMA. Additionally, it provides alerts when the momentum flips bullish or bearish.

Key Features:
  • The RMI helps to identify momentum in the market.
  • Three EMAs (Fast, Standard, and Slow) were calculated on the RMI. These can be utilized to analyze the momentum trend over different periods.
  • Highlighted regions and colour coding to indicate when RMI crosses its Slow EMA, signalling potential momentum shifts.
  • Customizable parameters: Users can specify the lengths of the RMI and EMAs, boundaries for RMI, and colours for various components of the plot.
  • Alerts: The script can alert users when the momentum has flipped bullish or bearish.


The script is organized into several sections:
  • Inputs: The user can customize several parameters including the RMI averaging length, momentum lookback, RMI boundaries, and the EMA lengths. In addition, users can also specify the colours for the RMI line, Slow EMA line, and the fill colour.
  • RMI Calculation: The script calculates the RMI based on the user-provided length and momentum lookback. This is done by first calculating two EMAs - one for the positive differences between closing prices (emaInc), and one for the negative differences (emaDec). Then, the RMI is computed using these EMAs.
  • Plotting: The script plots the RMI line, Slow EMA line, and two horizontal lines indicating the RMI boundaries. In addition, it also fills the region between the RMI and Slow EMA lines.
  • Conditions: The script computes the conditions for bullish and bearish momentum flips. These are defined as when the RMI crosses above or below the Slow EMA respectively.
  • Alerts: Finally, the script sets up two alert conditions based on the bullish and bearish conditions. These alert the user when the momentum has flipped bullish or bearish, with a message that includes the current RMI value.
Release Notes
Added license
Exponential Moving Average (EMA)Momentum Indicator (MOM)Relative Momentum Indexrmi

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Wizard money evangelist 🪄✨

Disclaimer