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.

Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?