OPEN-SOURCE SCRIPT

EMA21 Speed & Accel

Updated
The script calculates an plots first and second derivatives of a EMA of "length" periods, with a default value of 21 periods.

- Blue curve is the first derivative of the EMA, which can be interpreted as the "speed" , "slope", or percentage of gains (or loses) walking over the EMA, measured in % per period. If timeframe is Days, it will show a %/day on the scale @ the right of graphic.

- Fuchsia curve is the second derivative of the EMA, and can be assumed to be the "acceleration" or driving force that could augment or diminish the EMA Speed.

When Speed & Acceleration ar both >=0, EMA is in positive rally, and becoming stepper, so the bacground is colored green.

First and second derivatoves are performed using "basis functions", as are applied in FEM implementation.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

El Script calcula y plotea la primera y segunga derivada de una EMA de "length" períodos, con un valor por defecto de 21.

- La curva azul es la primera derivada de la EMA; que puede ser interpretada conmo su "velocidad", "pendiente" o % de ganancia o pérdida que se tendría sobre la EMA. Cuando la unidad de tiempo del gráfico es Días, permite visualizar en la escala de la derecha el % de ganancia o pérdida por día.

- La curva Fucsia muestra la segunda derivada, o "Aceleración", que se puede interpretar como la fuerza que puede aumentar o dismu¿inuir la pendiente de la EMA.

Cuando la Velocidad y Aceleración son mayores que cero, las ganancias aumentan cada período, y el findo de colorea de verde.

Las derivadas primera y segunda se calculan usando técnicas de funciones de forma, como las aplicadas en el MEF.
Release Notes
Scale of EMA Acceleration (curvature) is calculated automatically
Moving AveragesTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer