The most basic of trend indicators is the price change over some period of time. Rate of change is the most common indicator to use which calculates the current price minus the price n bars back. I've written this indicator to solve several problems the default value of ROC.
1. We're interested in the magnitude or strength of the slope of change. 2. We need a number that we can make decisions from between 0 and something close to a peak of 10. 3. We need the ability to define a threshold where a directional change might be taking place.
The Directional Slope Strength Index solves these problems by taking 1000 samples of your given Rate of Change input and calculating a standard score (or z-score) which represents the number of standard deviations by which the current rate of change is above or below the historical average. A higher number represents a stronger move up and a lower (negative) number represents a stronger move down. A value closer to 0 would represent a sideways trend or the slowing of a current trend.
A potential threshold could be 2 or -2 which is two standard deviations from the mean ROC.
The inputs can be modified to control the sensitivity.
1. A lower ROC length would provide a more sensitive measure, but still measure how that sensitive input changes over 1000 samples. 2. I recommend keeping the sample rate at 1000 as that provides enough historical data to give a more accurate distribution and therefore a more accurate DSSI (z-score).
A number of decisions can be made from the indicator:
1. When the DSSI crosses above 2, it could be a sign of a strong move upward. When below -2 it could be a sign of a strong downward move. 2. When the DSSI persists in a positive or negative channel between 0 and 2 or 0 and -2 this could indicate the formation of the next trend. 3. Values outside 2 and -2 standard deviations should be interpreted as high volatility environments. 4. For convenience, a highest and lowest DSSI have been plotted to provide references to the historical extremes.
I'm open to any questions and feedback as this is a first, original indicator for me.
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.
Automate your TradingView strategies through TradersPost.io to your favorite broker or exchange. Equities, futures, options, and crypto supported!
Мои профили:
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.