However, ATR itself could get spiked by some violent moves. For this I have created MinATR which I am publishing here.
It is effectively ATR + minimum ATR over the last "Min Length" bars. (this is a parameter which I have defaulted to 50).
So use this the same way you use ATR, but it will also show the min ATR over the last "Min Length" periods.
Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con las Normas internas. Puede marcarlo como favorito para usarlo en un gráfico.
I do normally make calculations for the day, I want them to be constant, so I only do calculations on closed bars, not currently developing ones.
Otherwise at the open you will often have a super minimal ATR, even though the price could move significantly that day.
That said I am not actually doing anything special other than taking the ``lowest(atr, minlength)``.
In general the goal of this indicator is not to find sudden changes, but rather find a "multiplier" we can use to have consistent calculations for stops/profit targets/etc.
Can you post a chart, or tell me the stock symbol you were looking at so I can take a peek as well?
I actually use the prior day's ATR / MinATR, which is set in stone. I think as it is right now the current day does update as it unfolds, but you don't really want to look at that.
If you're looking for momentum indicators - two things 1) look at lower time frame, not daily, and 2) use actual momentum indicators such as RSI.
Good news is that Pine Script seems to be constantly improving and may be one day I'll be able to implement some of the more advanced stuff in here as well.