---
url: /indicators/ht-trendline.md
description: >-
  Created by John Ehlers, the Hilbert Transform Instantaneous Trendline is a
  5-period trendline of high/low price that that uses classic electrical
  radio-frequency signal processing algorithms reduce noise.
package: FacioQuo.Stock.Indicators
docs_version: v3
canonical: https://dotnet.stockindicators.dev/indicators/ht-trendline
generated: 2026-09-30T04:41:06.055Z
commit: ae1f432eaa0b03ae9f39e032c69434b557efa4a2
---

# Hilbert Transform Instantaneous Trendline

Created by John Ehlers, the Hilbert Transform Instantaneous Trendline is a 5-period trendline of high/low price that that uses classic electrical radio-frequency signal processing algorithms reduce noise.  Dominant Cycle Periods information is also provided.
[\[Discuss\] 💬](https://github.com/facioquo/stock-indicators-dotnet/discussions/363 "Community discussion about this indicator")

```csharp
// C# usage syntax
IReadOnlyList<HtlResult> results =
  bars.ToHtTrendline();
```

## Historical price bars requirements

You must have at least `100` periods of `bars` to cover the [warmup and convergence](https://github.com/facioquo/stock-indicators-dotnet/discussions/688) periods.

`bars` is a collection of generic `TBar` historical price bars.  It should have a consistent frequency (day, hour, minute, etc).  See [the Guide](/guide/getting-started.md#historical-bars) for more information.

## Response

```csharp
IReadOnlyList<HtlResult>
```

* This method returns a time series of all available indicator values for the `bars` provided.
* It always returns the same number of elements as there are in the historical price bars.
* It does not return a single incremental indicator value.
* The first `6` periods will have `null` values for `SmoothPrice` since there's not enough data to calculate.
* The first `7` periods will have `null` values for `DcPeriods` since there is not enough data to calculate; and are generally unreliable for the first ~25 periods.

> [!WARNING]
> **🚩 ⚞ Convergence warning**
>
> The first `100` periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.

### `HtlResult`

| property | type | description |
| -------- | ---- | ----------- |
| `Timestamp` | *`DateTime`* | Date from evaluated `TBar` |
| `DcPeriods` | *`int`* | Dominant cycle periods (smoothed) |
| `Trendline` | *`double`* | HT Trendline |
| `SmoothPrice` | *`double`* | Weighted moving average of `(H+L)/2` price |

### Utilities

* [.Condense()](/utilities/results.md#condense)
* [.Find(lookupDate)](/utilities/results.md#find-by-date)
* [.RemoveWarmupPeriods()](/utilities/results.md#remove-warmup-periods)
* [.RemoveWarmupPeriods(removePeriods)](/utilities/results.md#remove-warmup-periods)

See [Utilities and helpers](/utilities.md) for more information.

## Streaming

### Real-time streaming

Use the streaming hub for real-time incremental calculations:

```csharp
BarHub barHub = new();
HtTrendlineHub observer = barHub.ToHtTrendlineHub();

foreach (IBar bar in bars)  // simulating stream
{
  barHub.Add(bar);
}

IReadOnlyList<HtlResult> results = observer.Results;
```

### Buffer-style streaming

Use the buffer-style `List<T>` when you need incremental calculations:

```csharp
HtTrendlineList htlList = new();

foreach (IBar bar in bars)  // simulating stream
{
  htlList.Add(bar);
}

// based on `ICollection<HtlResult>`
IReadOnlyList<HtlResult> results = htlList;
```

See [Buffer lists](/guide/styles/buffer.md) and [Stream hubs](/guide/styles/stream.md) for full usage guides.

## Chaining

This indicator may be generated from any chain-enabled indicator or method.

```csharp
// example
var results = bars
    .Use(CandlePart.HLC3)
    .ToHtTrendline(..);
```

Results can be further processed on `Trendline` with additional chain-enabled indicators.

```csharp
// example
var results = bars
    .ToHtTrendline(..)
    .ToRsi(..);
```

See [Chaining indicators](/guide/chaining.md) for more.
