OPEN-SOURCE SCRIPT

Daily Moving Averages on Intraday Charts

This moving average script displays the chosen 5 daily moving averages on intraday (minute) charts. It automatically adjusts the intervals to show the proper moving averages.

In a day there are 375 trading minutes from 9:15 AM to 3:30PM in Indian market. In 5 days there are 1875 minutes. For other markets adjust this data accordingly.

If 5DMA is chosen on a five minute chart the moving average will use 375 interval values (1875/5 = 375) of 5minute chart to calculate moving average. Same 5DMA on 25minute chart will use 75 interval values (1875/25 = 75).

On a 1minute chart the 5DMA plot will use 1875 interval values to arrive at the moving average.
Since tradingview only allows 5000 intervals to lookback, if a particular daily moving average on intraday chart needs more than 5000 candle data it won't be shown. E.g 200DMA on 5minute chart needs 15000 candles data to plot a correct 200DMA line. Anything less than that would give incorrect moving average and hence it won't be shown on the chart.

MA crossover for the first two MAs is provided. If you want to use that option, make sure you give the moving averages in the correct order.

You can enhance this script and use it in any way you please as long as you make it opensource on TradingView. Feedback and improvement suggestions are welcome.

Special thanks to JohnMuchow for his moving averages script for all timeframes.
dailymovingaverageExponential Moving Average (EMA)intradaymoving_averageMoving Averagesmovingaveragecrossovermultiplemovingaveragemultipletimeframemultitimeframe

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?

Exención de responsabilidad