OPEN-SOURCE SCRIPT
已更新 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.
版本注释
- Updated to include a summary table and added customizable inputs- Now plots the Days Above ATH along with the Z-Score
版本注释
Fixed bug making >10% positive moves to count as a 10% drop causing the counter to restart.版本注释
Make the step to change the percent drawdown to be 0.1开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。