PROTECTED SOURCE SCRIPT

DAILY ATR LEVELS

Aggiornato
This script is a custom technical indicator for use in TradingView, designed to display daily Average True Range (ATR) levels on the chart, along with the daily opening price. It provides a customizable way to track price levels relative to the daily ATR, which can be useful for traders looking for volatility-based price targets or ranges.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Customization Options:
- Line Width: Determines the thickness of the plotted lines for the ATR levels and daily open line, ranging from 1 to 10.
- Right Offset (minutes): A time offset (in minutes) that shifts the end of the daily opening price line to the right for visual clarity.
- Line Style: The user can choose between solid, dashed, or dotted lines for all the plotted levels.
- Display Options: Users can toggle the visibility of the daily opening price line (showDayLevel), labels (showLabels), and ATR levels (showATRLevels).
- Colors: Customizable colors for the daily opening price line (dayLevelColor), labels (labelTextColor), and the ATR levels for both positive and negative values (atrLevelPlusColor and atrLevelMinusColor).

ATR Settings:
- ATR Length: Defines the number of periods (bars) to use when calculating the ATR. The default is 180, which corresponds to the ATR calculated on the daily chart using the last 180 bars.
- ATR Multiplier: Allows the user to scale the ATR levels by a multiplier (from 0.1 to 5.0), adjusting the sensitivity of the levels.
- ATR Levels: Users can toggle visibility for several predefined ATR levels, such as +25%, +50%, +75%, +100%, -25%, -50%, -75%, and -100%. These levels represent price points above or below the daily open based on the ATR.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ATR Levels Calculation:
- The ATR is calculated based on the daily chart using the ta.atr() function with the specified ATR length, default is set at 180.
- The script computes multiple ATR levels above and below the daily open price, adjusting each level by 25%, 50%, 75%, and 100% of the ATR value (scaled by the ATR multiplier).

ATR Level Plotting:
- For each ATR level (positive and negative), a line is drawn across the chart at the corresponding price level.
- The color, line style, and width of these lines can be customized.
- Each ATR level also has an optional label showing the percentage level (e.g., "ATR +25%") at the specified price, which is positioned at the end of the line.
- The labels are removed from the previous bars to avoid clutter.

Workflow:
- The script first calculates the daily opening price using the request.security() function to pull the open price from the daily chart.
- It then calculates the ATR based on the selected length and multiplier.
- The start time for the daily open line is determined by the bar's timestamp at the start of the day, and the end time is adjusted using the user-defined right offset.
- After determining the relevant price levels (for the opening price and ATR levels), the script plots these levels on the chart as lines. It handles the drawing and deletion of lines to ensure that the chart remains updated in real time.
- If labels are enabled, text labels are displayed next to the ATR levels and the daily open line, providing clear markers for the user.

Practical Use:
- Volatility Analysis: This indicator is useful for identifying key price levels based on daily volatility (ATR). Traders can use it to set potential targets or support/resistance levels that are adjusted for volatility.
- Day Trading or Swing Trading: The daily opening price line helps traders quickly see where the price opened for the day, and the ATR levels give a dynamic range for the day's potential price movement.

Overall, this script is designed to provide a clear, customizable view of daily price levels in relation to the ATR, helping traders make informed decisions based on volatility and price action.
Note di rilascio
This script is a custom technical indicator for use in TradingView, designed to display daily Average True Range (ATR) levels on the chart, along with the daily opening price. It provides a customizable way to track price levels relative to the daily ATR, which can be useful for traders looking for volatility-based price targets or ranges.

///////////////////////////////////////////////////////////////////////////////////////////////////////

Customization Options:
- Line Width: Determines the thickness of the plotted lines for the ATR levels and daily open line, ranging from 1 to 10.
- Right Offset (minutes): A time offset (in minutes) that shifts the end of the daily opening price line to the right for visual clarity.
- Line Style: The user can choose between solid, dashed, or dotted lines for all the plotted levels.
- Display Options: Users can toggle the visibility of the daily opening price line, labels, and ATR levels.
- Colors: Customizable colors for the daily opening price line, labels, and the ATR levels for both positive and negative values.

ATR Settings:
- ATR Length: Defines the number of periods (bars) to use when calculating the ATR. The default is 180, which corresponds to the ATR calculated on the daily chart using the last 180 bars.
- ATR Multiplier: Allows the user to scale the ATR levels by a multiplier (from 0.1 to 5.0), adjusting the sensitivity of the levels.
- ATR Levels: Users can toggle visibility for several predefined ATR levels, such as +25%, +50%, +75%, +100%, -25%, -50%, -75%, and -100%. These levels represent price points above or below the daily open based on the ATR.

///////////////////////////////////////////////////////////////////////////////////////////////////////

ATR Levels Calculation:
- The ATR is calculated based on the daily chart using the ta.atr() function with the specified ATR length, default is set at 180.
- The script computes multiple ATR levels above and below the daily open price, adjusting each level by 25%, 50%, 75%, and 100% of the ATR value (scaled by the ATR multiplier).

ATR Level Plotting:
- For each ATR level (positive and negative), a line is drawn across the chart at the corresponding price level.
- The color, line style, and width of these lines can be customized.
- Each ATR level also has an optional label showing the percentage level (e.g., "ATR +25%") at the specified price, which is positioned at the end of the line.
- The labels are removed from the previous bars to avoid clutter.

Workflow:
- The script first calculates the daily opening price using the request.security() function to pull the open price from the daily chart.
- It then calculates the ATR based on the selected length and multiplier.
- The start time for the daily open line is determined by the bar's timestamp at the start of the day, and the end time is adjusted using the user-defined right offset.
- After determining the relevant price levels (for the opening price and ATR levels), the script plots these levels on the chart as lines. It handles the drawing and deletion of lines to ensure that the chart remains updated in real time.
- If labels are enabled, text labels are displayed next to the ATR levels and the daily open line, providing clear markers for the user.

Practical Use:
- Volatility Analysis: This indicator is useful for identifying key price levels based on daily volatility (ATR). Traders can use it to set potential targets or support/resistance levels that are adjusted for volatility.
- Day Trading or Swing Trading: The daily opening price line helps traders quickly see where the price opened for the day, and the ATR levels give a dynamic range for the day's potential price movement.

Overall, this script is designed to provide a clear, customizable view of daily price levels in relation to the ATR, helping traders make informed decisions based on volatility and price action.
ATRatrrangeAverage True Range (ATR)rangeriskmangementSupport and ResistancesupportandresitanceVolatility

Script protetto

Questo script è pubblicato con codice protetto, ma puoi comunque usarlo gratuitamente. Mettendolo tra i preferiti potrai applicarlo al grafico, senza però la possibilità di visualizzare o modificare il codice sorgente.

Vuoi usare questo script sui tuoi grafici?

Declinazione di responsabilità