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 автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.