Files
QuanTAlib/lib/averages/t3/T3.md
T

75 lines
3.0 KiB
Markdown
Raw Normal View History

2025-12-07 17:10:41 -08:00
# T3: Tillson T3 Moving Average
## Overview and Purpose
2025-12-07 17:10:41 -08:00
The Tillson T3 Moving Average is an advanced technical indicator designed to provide superior smoothing with minimal lag. Developed by Tim Tillson and introduced in the January 1998 issue of Technical Analysis of Stocks & Commodities magazine, T3 implements a sophisticated six-stage EMA architecture with optimized coefficient distribution based on a volume factor parameter.
Unlike simpler moving averages or even triple-EMA approaches, T3 uses a unique mathematical framework that strategically combines multiple EMAs with precisely calculated coefficients. This approach creates a moving average that effectively reduces noise while preserving important trend information and minimizing lag.
## Core Concepts
2025-12-07 17:10:41 -08:00
* **Multi-stage smoothing:** Uses a six-stage EMA cascade with optimized coefficient distribution to achieve superior noise reduction while minimizing lag
* **Volume factor customization:** Provides a parameter that allows traders to fine-tune the balance between smoothness and responsiveness
* **Strategic coefficient weighting:** Employs a sophisticated formula that prevents overshooting at turning points while maintaining responsiveness
## Calculation and Mathematical Foundation
2025-12-07 17:10:41 -08:00
T3 works by running price data through a series of six EMAs, then combining the outputs of these EMAs using carefully calculated weights. These weights are determined by a "volume factor" parameter ($v$) that controls how much the indicator prioritizes smoothness versus responsiveness.
### Formula
2025-12-07 17:10:41 -08:00
$$ T3 = c_1 \cdot EMA_6 + c_2 \cdot EMA_5 + c_3 \cdot EMA_4 + c_4 \cdot EMA_3 $$
Where:
2025-12-07 17:10:41 -08:00
* $EMA_1$ through $EMA_6$ are exponential moving averages applied in sequence:
* $EMA_1(x) = EMA(x)$
* $EMA_n(x) = EMA(EMA_{n-1}(x))$
* Coefficients are derived from the volume factor $v$:
* $c_1 = -v^3$
* $c_2 = 3(v^2 + v^3)$
* $c_3 = -3(2v^2 + v + v^3)$
* $c_4 = 1 + 3v + 3v^2 + v^3$
* Default volume factor $v = 0.7$
## Parameters
2025-12-07 17:10:41 -08:00
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Period | 10 | > 0 | The smoothing period for the internal EMAs |
| Volume Factor | 0.7 | 0-1 | Controls responsiveness vs smoothness (0.618 is also a common value) |
## C# Usage
### Standard TSeries Usage
2025-12-07 17:10:41 -08:00
```csharp
// Calculate T3 with period 10 and default volume factor 0.7
var t3 = T3.Calculate(sourceSeries, 10);
// Calculate T3 with period 10 and volume factor 0.618
var t3_custom = T3.Calculate(sourceSeries, 10, 0.618);
Console.WriteLine($"T3 Value: {t3.Last.Value}");
```
### Eventing and Reactive Support
2025-12-07 17:10:41 -08:00
The `T3` class implements `ITValuePublisher`, allowing for event-driven updates.
```csharp
// Create a publisher source
var source = new TValuePublisher();
// Create T3 consumer attached to the source
var t3 = new T3(source, period: 10, vfactor: 0.7);
// Handle updates
t3.Pub += (result) => {
Console.WriteLine($"New T3 Value: {result.Value} at {result.Time}");
};
// Push new values to source
source.Publish(new TValue(DateTime.UtcNow, 100.0));
```