OPEN-SOURCE SCRIPT

ATH/ATL tracker

업데이트됨
This script calculates and displays in a table in realtime:
- ATH, date of occurrence, and that price/current price
- ATL, date of occurrence, and that price/current price
- ATH of the current year, date of occurrence, and that price/current price
- ATL of the current year, date of occurrence, and that price/current price
릴리즈 노트
This script calculates and displays in a table in realtime:
- ATH, date of occurrence, and that price/current price
- ATL, date of occurrence, and that price/current price
- ATH of the current year, date of occurrence, and that price/current price
- ATL of the current year, date of occurrence, and that price/current price
It can also display ATH and ATL levels, but that Style option is by default turned off.
릴리즈 노트
“Comprehensive ATH/ATL Tracker” is a Pine Script indicator designed to track and display the All-Time High (ATH) and All-Time Low (ATL) prices of a security, along with their respective dates. Additionally, it provides the highest and lowest prices for the current year (Year-To-Date, YTD). This script is particularly useful for traders and analysts who want to keep an eye on significant price levels and their historical context.

Functionality:

- All-Time High/Low Tracking: The script calculates and displays the highest and lowest prices ever recorded for the security.
- Yearly High/Low Tracking: It also tracks the highest and lowest prices for the current year.
- Delta Calculation: The script calculates the percentage difference (delta) between the current price and the ATH/ATL prices.
- Visual Representation: Users can choose to display these levels on the chart and in a table format for easy reference.

How It Works:

1. Inputs: The script allows users to toggle the display of ATH, ATL, and a statistics table.
2. Functions:
- get_all_time_high() and get_all_time_low() functions iterate through historical data to find the ATH and ATL.
- get_yearly_high(year) and get_yearly_low(year) functions find the highest and lowest prices for a specified year.
3. Data Request: The script uses request.security() to fetch ATH, ATL, and YTD high/low data.
4. Delta Calculation: It calculates the delta values as the percentage difference between the ATH/ATL prices and the current closing price.
5. Plotting:
- If enabled, the script plots horizontal lines at the ATH and ATL levels.
- It creates a table at the bottom-right of the chart displaying the ATH, ATL, YTD high, and YTD low prices, their dates, and the delta values.

Usage Instructions:

1. Add the Indicator: Apply the “Comprehensive ATH/ATL Tracker” indicator to your TradingView chart.
2. Configure Settings: Use the input options to toggle the display of ATH, ATL, and the statistics table.
3. Interpret the Data:
- The horizontal lines (if enabled) will show the ATH and ATL levels directly on the chart.
- The table will provide a detailed view of these levels, including their dates and the percentage difference from the current price.

Concepts Underlying the Calculations:
- All-Time High/Low: These are the highest and lowest prices ever recorded for the security, providing key levels of historical significance.
- Year-To-Date High/Low: These levels help traders understand the security’s performance within the current year.
- Delta: The percentage difference between the current price and the ATH/ATL levels, offering insight into how far the price has moved from these significant levels.

This script is a powerful tool for traders who want to keep track of critical price levels and their historical context, aiding in making informed trading decisions.
GrowthPortfolio managementValue

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항