OPEN-SOURCE SCRIPT
Cập nhật Days Above ATH Z-Score

This indicator calculates the average number of days that the price is above its last ATH before suffering a significant dump. Then, it uses the average and the standard deviation to calculate the current Z-Score when breaking an ATH.
How to use it?
- You can customize the acceptable percentage drawdown in price before calling the streak broken. 10% gives a good signal.
- You can decide to plot 4 different time periods of price highs. By default they are 1 month back, 3 months back, 500 days back and then the absolute ATH. The time period is customizable.
- Besides plotting you can also decide whether to include a certain time period statistics to the overall Z-Score, which is the average of the selected Z-Scores. By default the indicator only uses the All-Times-High to calculate the Z Score of the Days Above it.
- The table displays all relevant stats by colors which correspond to the plots.
Provided signal:
- It can be a good tool to identify good selling opportunities in local tops.
- During the last local top (March 14th) it marked a Z-Score slightly above 2 exactly at the top before BTC started dumping.
- This script is supposed to get more accurate overtime as we break new ATHs. Therefore, I would not pay attention to Z-Scores before this (2024-2025) and the last bull run.
- I included 4 different customizable lookback periods for the calculations, you can enable or disable them as you please (I recommend using only one at once but you can experiment with it). All 4 Z-Scores get averaged in the final signal.
- The default value for the price drop threshold is 10% as it gave me a good signal along with the source for the drop being the Low of each candle. It is worth noticing that when the source is changed to Close for example, the threshold should be lowered to adjust for the volatility reduction by changing it from Low to Close
- This is not meant to be financial advice.
How to use it?
- You can customize the acceptable percentage drawdown in price before calling the streak broken. 10% gives a good signal.
- You can decide to plot 4 different time periods of price highs. By default they are 1 month back, 3 months back, 500 days back and then the absolute ATH. The time period is customizable.
- Besides plotting you can also decide whether to include a certain time period statistics to the overall Z-Score, which is the average of the selected Z-Scores. By default the indicator only uses the All-Times-High to calculate the Z Score of the Days Above it.
- The table displays all relevant stats by colors which correspond to the plots.
Provided signal:
- It can be a good tool to identify good selling opportunities in local tops.
- During the last local top (March 14th) it marked a Z-Score slightly above 2 exactly at the top before BTC started dumping.
- This script is supposed to get more accurate overtime as we break new ATHs. Therefore, I would not pay attention to Z-Scores before this (2024-2025) and the last bull run.
- I included 4 different customizable lookback periods for the calculations, you can enable or disable them as you please (I recommend using only one at once but you can experiment with it). All 4 Z-Scores get averaged in the final signal.
- The default value for the price drop threshold is 10% as it gave me a good signal along with the source for the drop being the Low of each candle. It is worth noticing that when the source is changed to Close for example, the threshold should be lowered to adjust for the volatility reduction by changing it from Low to Close
- This is not meant to be financial advice.
Phát hành các Ghi chú
- Updated to include a summary table and added customizable inputs- Now plots the Days Above ATH along with the Z-Score
Phát hành các Ghi chú
Fixed bug making >10% positive moves to count as a 10% drop causing the counter to restart.Phát hành các Ghi chú
Make the step to change the percent drawdown to be 0.1Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.