Files
QuanTAlib/lib/trends/t3/T3.md
T
Miha Kralj a7b7207801 Refactor documentation to remove "Zero-Allocation Design" sections across various trend indicators and implement a PowerShell script for automated cleanup
- Updated mathematical foundations and performance profiles where necessary to maintain clarity and coherence.
2025-12-21 14:37:44 -08:00

56 lines
2.2 KiB
Markdown

# T3: Tillson T3 Moving Average
> "If one EMA is good, six must be better. Tim Tillson's logic is impeccable, provided you hate noise more than you love latency."
The T3 Moving Average is a hyper-smooth, low-lag filter that cascades six Exponential Moving Averages (EMAs). Unlike standard cascading (which increases lag), T3 uses a "Volume Factor" ($v$) to weight the EMAs in a way that partially cancels out the lag, resulting in a curve that is smoother than an EMA but more responsive than an SMA.
## Historical Context
Introduced by Tim Tillson in *Technical Analysis of Stocks & Commodities* (Jan 1998), "Smoothing Techniques for More Accurate Signals." Tillson sought to improve upon the DEMA (Double EMA) and TEMA (Triple EMA) concepts by generalizing the lag-reduction mathematics.
## Architecture & Physics
T3 is essentially a filter of filters. It passes data through a chain of 6 EMAs:
$Input \to EMA_1 \to EMA_2 \to EMA_3 \to EMA_4 \to EMA_5 \to EMA_6$
It then combines these outputs using coefficients derived from the Volume Factor ($v$).
### The Volume Factor ($v$)
* **$v = 0$**: T3 becomes a standard EMA (actually, a triple EMA of EMAs).
* **$v = 1$**: T3 behaves like DEMA/TEMA with aggressive lag reduction (and potential overshoot).
* **$v = 0.7$**: The default. A "Goldilocks" zone of smoothness and responsiveness.
## Mathematical Foundation
### 1. Coefficients
Given $v$ (default 0.7):
$$ c_1 = -v^3 $$
$$ c_2 = 3v^2 + 3v^3 $$
$$ c_3 = -6v^2 - 3v - 3v^3 $$
$$ c_4 = 1 + 3v + 3v^2 + v^3 $$
### 2. The Formula
(Note: There are multiple variations of T3. QuanTAlib uses the standard Tillson formula).
$$ T3 = c_1 e_6 + c_2 e_5 + c_3 e_4 + c_4 e_3 $$
Where $e_n$ is the output of the $n$-th EMA in the cascade.
## Performance Profile
Despite the complexity, T3 is O(1).
## Validation
Validated against TA-Lib and Skender.Stock.Indicators.
### Common Pitfalls
1. **Warmup**: Because it cascades 6 EMAs, T3 takes significantly longer to stabilize than a standard EMA. A T3(10) might need 60+ bars to converge.
2. **Overshoot**: With high $v$ values ($>1$), T3 can overshoot price turns, creating false breakout signals.
3. **Complexity**: It is computationally heavier than SMA or EMA (approx 6x ops), though still negligible on modern CPUs.