peacefulLizard50262

Triple Brown's Exponential Smoothing (TBES)

This script is a PineScript implementation of the Triple Exponential Moving Average (TEMA) indicator, which is a trend-following indicator used in technical analysis. The TEMA attempts to reduce the lag present in other moving averages by using a triple exponential smoothing technique.

The script begins by declaring the function "indicator" with the name "TBES", and setting the "overlay" parameter to "true" to display the indicator on top of the price chart. It also defines an input parameter called "Source" which is the source data for the TEMA calculation (usually the closing price of a financial asset). It also defines an input parameter called "Alpha" which is a smoothing factor that controls the weighting of the TEMA calculation.

The script then defines the "bes" function, which stands for "Brown's Exponential Smoothing". This function takes in the source data and the alpha smoothing factor as input, and applies the double exponential smoothing calculation to produce a smoothed version of the source data.

The "tbes" function is then defined, which stands for "Triple Brown's Exponential Smoothing" and calculates the TEMA. It does this by first applying the "bes" function to the source data, then applying it again to the output of the first "bes" calculation, and then applying it a third time to the output of the second "bes" calculation. The final TEMA value is then calculated as the sum of three times the difference between the output of the first "bes" calculation and the output of the second "bes" calculation, and the output of the third "bes" calculation.

Finally, the script plots the TEMA value on the chart in green color by calling the "plot" function and passing it the output of the "tbes" function, along with a string label for the indicator.

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?