OPEN-SOURCE SCRIPT

Pink's Daily SMA Script

Telah dikemas kini
🚗 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.
Nota Keluaran
Now properly resets every day instead of having old lines from prior days.


Use Case for "Pink's Daily SMA Script"
Purpose:

"Pink's Daily SMA Script" is a powerful technical analysis tool designed for traders and investors who rely on moving averages (MAs) to track trends and identify potential trade entry and exit points. This script calculates and displays several key Simple Moving Averages (SMAs) for the current day only, allowing users to focus on today's price action without the distraction of historical SMA levels.
Overview:

The script allows users to input and toggle up to nine customizable SMAs, sorted by length, and view their real-time levels plotted on the current day's chart. In addition, users can highlight specific time periods (e.g., 11:00 AM to 11:05 AM and 1:00 PM to 1:30 PM) for a more detailed analysis during key intraday periods.

The key feature is that the SMAs and their associated labels are only visible on the current day’s price action, which helps declutter the chart and emphasizes relevant information for active day traders.
Target Audience:

This script is ideal for:

Day Traders who focus on intraday price movements and need to see how the price interacts with current SMAs without interference from previous day levels.
Swing Traders who want to track key SMA levels daily while managing multiple trades.
Technical Analysts who perform chart studies, leveraging various SMA lengths to gauge short-term and long-term market sentiment.

Core Features:

Customizable SMAs: The script allows users to configure up to nine SMAs with different lengths. These SMAs can be used to represent various time frames, from short-term to long-term trends.

Daily Reset: SMAs are reset each day and are only visible on the current trading day, preventing clutter from prior days' levels. This feature is especially useful for day traders who only care about today's levels.

Intraday Highlighting: Users can highlight important intraday time periods, such as the opening hours or specific times where significant market activity typically occurs.

Dynamic Labels: Each SMA is labeled with its current value, allowing for easy identification and quick decision-making. The labels dynamically update throughout the day as new SMA values are calculated.

Real-World Example Use Case:

A day trader focuses on multiple assets and uses a combination of short-term (e.g., 10, 20, and 30-period) and longer-term (e.g., 100, 200-period) SMAs to analyze intraday price movements. On a busy trading day, the trader uses this script to plot the 10, 20, and 30-period SMAs to monitor the stock’s reaction to short-term price trends. At the same time, the 100 and 200-period SMAs provide a sense of the broader trend.

The trader appreciates that the script only displays the current day's SMA levels, which helps keep their chart clean and focused on real-time information, without old levels from previous days cluttering the view. They can also highlight key time periods (e.g., 11:00 AM to 11:05 AM and 1:00 PM to 1:30 PM) to identify potential volatility windows.

This focused view allows the trader to make quick decisions based on the interaction between the price and these key SMA levels during the trading session.
How It Adds Value:

Minimizes Chart Clutter: By only displaying today’s SMA values, traders can focus solely on real-time price action, reducing cognitive overload from irrelevant data.

Intraday Focus: Traders benefit from having a clean and precise view of key SMA levels throughout the trading session, making it easier to spot trend changes or price reversals.

Customization: With up to nine SMAs, this script can cater to a wide range of strategies, from short-term scalping to long-term swing trading.

Conclusion:

"Pink's Daily SMA Script" provides traders with a clean, customizable, and focused tool for analyzing key SMA levels within the current trading day. By displaying only the relevant data and removing unnecessary information from previous days, traders can make more informed and timely decisions based on the interaction of price with critical SMA levels.
Simple Moving Average (SMA)

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?

Penafian