gregoryberzin

Percent Change Smoothed (PCT + EMA)

ROC works great on data with only positive numbers (like prices).
But it fails to correctly represent the rate of change when source series have negative values.

ROC is positive when:
  • Source is positive AND Source is rising
  • OR Source is negative AND Source is falling

Percent change (PCT) is just a ROC that deals with this sign confusion.
Anyone with Data Science backgroud would likely know about it.

PCT is positive only when:
  • Source is rising

When applying to only positive data PCT = ROC they are exactly equal.

I've also added EMA smoothing option.

Enjoy!
Script de código abierto

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 lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?