OPEN-SOURCE SCRIPT

Pink's Daily SMA Script

Por PureDelta
🚗 This script provides a customizable overlay of seven simple moving averages (SMAs) on the chart. Users can control the display of each SMA by toggling them on or off. The lengths of these SMAs are adjustable, allowing for tailored analysis based on individual preferences.

📊 The script calculates daily SMA values using the request.security() function and plots them as horizontal lines on the chart. These SMAs are updated once per day, typically at the start of the pre-market session (9:00 AM in the "America/New_York" timezone). The script resets the SMA values at the start of each new day, ensuring fresh data for daily analysis.

🕒 In addition to the SMAs, the script includes an optional feature that highlights specific time ranges on the chart: from 11:00 AM to 11:05 AM and from 1:00 PM to 1:30 PM (based on the "America/New_York" timezone). Users can toggle these background highlights on or off, providing visual cues for key times during the trading day. The 11:00 AM window is highlighted in gray, while the 1:00 PM window is highlighted in blue.

🔖 The SMAs are labeled on the right side of the chart, with only one label visible at a time for each SMA. These labels display the length of the respective SMA, and their colors match the lines drawn on the chart, helping to distinguish between the different SMAs.

Special thanks to Pinks333 (tradingview.com/u/pinks333/
Who provided the logic for the script and was willing to share her logic and open source the script.
Simple Moving Average (SMA)

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal