How it is calculated
An SMA of an SMA that together cover length bars. For an odd length both are (length + 1) / 2 long, so length 5 weighs the prices 1 2 3 2 1; for an even length one is length / 2 long and the other length / 2 + 1, so length 4 weighs 1 2 2 1. The first value comes once length bars are in, as TA-Lib's TRIMA.
Reference: TA-Lib TRIMA
How to read it
It shows the underlying trend or cycle with little noise but turns late, about half a window after price. Better for seeing the trend than for timing entries.
In a strategy
A slow trend filter, for example longs only while ctx.ind("trima", length=30) is rising, or the centre line for bands of your own.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 20 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| TRIMA | Line |
Used in
No strategy template reads it yet.