KalmanTrend
KalmanTrend shows the strength of a trend: a Kalman filter estimates the speed of the price, and the indicator divides it by the standard error of this estimate. The result tells how confidently the price moves in one direction, not just where it goes.
The indicator is drawn in a separate area below the chart.
How to read it
- Above +2 is a confident rise, below −2 is a confident fall.
- Between the levels the direction does not stand out from the noise.
- The value falling at the same price means the trend is slowing down.
The price level from the same filter is shown by a moving average of the Kalman type — the MovingAverage indicator.
How it is calculated
- A Kalman filter estimates the level and the speed of the price set in Source. The price noise is estimated from the past price changes over Period bars.
- Period sets the smoothness of the filter the same way as for an EMA: the share of a new bar in the level is 2 / (period + 1).
- The trend strength is the speed divided by its standard error. A sharp price jump is capped so that it does not carry the speed estimate away.
The first value appears after 2 × period + 2 bars — on the 42nd bar with the default settings: first the noise estimate builds up, then the filter forgets its initial state.
Parameters
| Parameter | Description | Default |
|---|---|---|
| Period | The smoothness of the filter, as for an EMA: larger is smoother and later. At least 2. | 20 |
| Source | The bar price used in the calculation: Close — the close, Median — (High + Low) / 2, Typical — (High + Low + Close) / 3. | Close |
Plots
| Parameter | Description | Default |
|---|---|---|
| Trend strength | The speed of the price in its standard errors. | Orange, solid, width 1 |
Levels
| Parameter | Description | Default |
|---|---|---|
| Upper | Above it is a confident rise. | 2, blue |
| Lower | Below it is a confident fall. | −2, blue |
Style
The Trend strength line has the Plot (show the line), Label (show the last value on the right scale), Color, Width (1–5) and Style (Solid, Dashes, Dots) fields.
Each level has the Show, Value, Color, Width and Style fields. A visible level shows its value on the right scale.
How to add an indicator to the chart is described in Adding an indicator; parameters are changed in the indicator manager.