How it is calculated
The efficiency ratio ER is the absolute net change over length bars divided by the sum of the absolute bar to bar changes, 1 when nothing moved. The factor is (ER times (2/(fast+1) minus 2/(slow+1)) plus 2/(slow+1)) squared, and KAMA moves that share of the way to the price each bar. As TA-Lib's KAMA the first value needs length + 1 bars and starts from the previous price; fast 2 and slow 30 are TA-Lib's fixed values.
Reference: TA-Lib KAMA (Kaufman 1995)
How to read it
A flat KAMA means noise, a sloping one a trend. Price crossing it says more than with a fixed average because the line barely moves in a range, but after a long flat phase it reacts late to a breakout.
In a strategy
A trend filter or trailing line: go long when the close crosses above ctx.ind("kama", length=10, fast=2, slow=30) while the line itself is rising.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 10 | min 1, max 5000 |
Fast lengthfast | Whole number | 2 | min 1, max 500 |
Slow lengthslow | Whole number | 30 | min 1, max 500 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| KAMA | Line |
Used in
No strategy template reads it yet.