OPEN-SOURCE SCRIPT
Moving Average Index

Moving Average Index is an overlay indicator that manages up to ten moving averages at once and highlights their relationship to each other, rather than just displaying them side by side. It's built for anyone who wants to track several moving averages at the same time without the chart turning into a tangle of lines — for example to compare short- and long-term trends, or to keep multiple timeframes in view at once, and see at a glance how these averages relate to one another.
Each moving average can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
**Moving Average** (present ten times, MA 1–MA 10, each instance identically structured)
- Length: number of bars the average is calculated over.
- Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
- Source: the price or value the calculation is based on (e.g. close).
- Timeframe: a separate timeframe for this average; left empty, it uses the chart's timeframe. On a higher timeframe, the value updates within that timeframe's still-forming bar and can shift slightly until that bar closes.
- Line style: Line, Stepline, or Circles.
- Line width: thickness of the plotted line.
- Color: color of the line.

**Fill** (present three times, Fill 1–Fill 3, each instance identically structured)
- Connect: the two moving averages the area is drawn between.
- Bull / Bear: two colors: one for when the first selected average is above the second, the other for the opposite case.

Each enabled moving average is plotted as its own line, in the chosen style, width, and color. Up to three areas can also be shown between any two of these averages: their color switches automatically whenever the order of the two connected averages changes — one color while the first one is above, the other once it drops below. Once such an area is active, the indicator hides the two lines it connects; only the colored area remains visible, making trend changes stand out more clearly than with two crossing lines.


This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
Each moving average can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
**Moving Average** (present ten times, MA 1–MA 10, each instance identically structured)
- Length: number of bars the average is calculated over.
- Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
- Source: the price or value the calculation is based on (e.g. close).
- Timeframe: a separate timeframe for this average; left empty, it uses the chart's timeframe. On a higher timeframe, the value updates within that timeframe's still-forming bar and can shift slightly until that bar closes.
- Line style: Line, Stepline, or Circles.
- Line width: thickness of the plotted line.
- Color: color of the line.
**Fill** (present three times, Fill 1–Fill 3, each instance identically structured)
- Connect: the two moving averages the area is drawn between.
- Bull / Bear: two colors: one for when the first selected average is above the second, the other for the opposite case.
Each enabled moving average is plotted as its own line, in the chosen style, width, and color. Up to three areas can also be shown between any two of these averages: their color switches automatically whenever the order of the two connected averages changes — one color while the first one is above, the other once it drops below. Once such an area is active, the indicator hides the two lines it connects; only the colored area remains visible, making trend changes stand out more clearly than with two crossing lines.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.