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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.