OPEN-SOURCE SCRIPT
Enhanced TEMA with Decimal Periods

Imagine you have a special type of moving average line called a TEMA (Triple
Moving Average). A TEMA is designed to be even quicker to react to price changes than a regular EMA (Exponential Moving Average), helping traders spot trends faster.
What this script does:
Super-Precise TEMA Length:
Normally, when you set the "length" or "period" for a moving average, you use whole numbers (like 10 days, 20 days).
This script lets you be more precise and use decimal numbers for the TEMA's length (like 26.0 days, or even 26.7 days). This allows for very fine-tuning.
How it gets the "Decimal" EMA part (if you choose to use it):
If you want a TEMA with a length of, say, 26.7:
The script first needs to calculate EMAs with a length of 26.7.
To do this, it cleverly calculates two regular EMAs: one with a length of 26 and another with a length of 27 (the whole numbers just below and above 26.7).
Then, it blends these two EMAs. Since 26.7 is closer to 27, it takes more from the "27-period EMA" and a bit less from the "26-period EMA." This mix gives you an EMA that acts like it has a 26.7 period.
Building the TEMA:
A TEMA isn't just one EMA. It's made by taking an EMA of an EMA, and then an EMA of that. It's like smoothing the line multiple times, but in a special mathematical way to make it faster.
So, this script:
-Calculates the first "decimal EMA" (e.g., for 26.7).
-Calculates another "decimal EMA" of that first EMA line (again, using 26.7).
-Calculates a third "decimal EMA" of the second EMA line (still using 26.7).
Finally, it combines these three EMAs using a special TEMA formula to get the final, quick-reacting TEMA line.
Option to Switch Off Decimals:
There's a setting ("Use Decimal Periods"). If you turn this off, the script will just use regular whole-number EMAs to build the TEMA (it will round down your decimal input, so 26.7 would become 26).
Plotting:
The final "Enhanced TEMA" line is drawn on your price chart.
In Simple Terms:
This script gives you a TEMA (a fast-moving average) that you can set up with very precise decimal lengths (like 26.7 instead of just 26 or 27).
It does this "decimal magic" by smartly blending two regular EMAs. You can also choose to use it like a normal TEMA with whole numbers if you prefer. The goal is to give traders a very responsive trend-following line that can be fine-tuned to a high degree of precision.
Moving Average). A TEMA is designed to be even quicker to react to price changes than a regular EMA (Exponential Moving Average), helping traders spot trends faster.
What this script does:
Super-Precise TEMA Length:
Normally, when you set the "length" or "period" for a moving average, you use whole numbers (like 10 days, 20 days).
This script lets you be more precise and use decimal numbers for the TEMA's length (like 26.0 days, or even 26.7 days). This allows for very fine-tuning.
How it gets the "Decimal" EMA part (if you choose to use it):
If you want a TEMA with a length of, say, 26.7:
The script first needs to calculate EMAs with a length of 26.7.
To do this, it cleverly calculates two regular EMAs: one with a length of 26 and another with a length of 27 (the whole numbers just below and above 26.7).
Then, it blends these two EMAs. Since 26.7 is closer to 27, it takes more from the "27-period EMA" and a bit less from the "26-period EMA." This mix gives you an EMA that acts like it has a 26.7 period.
Building the TEMA:
A TEMA isn't just one EMA. It's made by taking an EMA of an EMA, and then an EMA of that. It's like smoothing the line multiple times, but in a special mathematical way to make it faster.
So, this script:
-Calculates the first "decimal EMA" (e.g., for 26.7).
-Calculates another "decimal EMA" of that first EMA line (again, using 26.7).
-Calculates a third "decimal EMA" of the second EMA line (still using 26.7).
Finally, it combines these three EMAs using a special TEMA formula to get the final, quick-reacting TEMA line.
Option to Switch Off Decimals:
There's a setting ("Use Decimal Periods"). If you turn this off, the script will just use regular whole-number EMAs to build the TEMA (it will round down your decimal input, so 26.7 would become 26).
Plotting:
The final "Enhanced TEMA" line is drawn on your price chart.
In Simple Terms:
This script gives you a TEMA (a fast-moving average) that you can set up with very precise decimal lengths (like 26.7 instead of just 26 or 27).
It does this "decimal magic" by smartly blending two regular EMAs. You can also choose to use it like a normal TEMA with whole numbers if you prefer. The goal is to give traders a very responsive trend-following line that can be fine-tuned to a high degree of precision.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.