OPEN-SOURCE SCRIPT

Moving Average Gap Analyzer

Updated
Extremely simple algorithm in order to calculate the gap between 2 simple moving averages. Analyzing perspective defines the line of color as white, green or red. This is done by checking sources of both moving averages and evaluate their past values with the mutual length respectively. Analysis is done by scoring the movements of sources.

What to expect?
- Higher the gap, higher the volatility.
- If the analysis line is green sources have been raising (most likely bull market), if the analysis line is white the market is mostly likely close to horizontal, if the analysis line is red, sources have been decreasing gradually (most likely bear market).

ps. Genuine indicator idea of me. This indicator is not a product or an idea of any group I work with. Completely clear of all types of IP.
Release Notes
- Option for selecting MA type added.
Release Notes
  • Script updated from Pine Script v4 to Pine Script v5
  • Dynamic moving average function moved to a library (Tools)
  • Strict variable types implemented & applied
gapmoving_averageMoving AveragesTrend AnalysisVolatilityvolatilityindicator

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?


Also on:

Disclaimer