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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。