How it is calculated
The leg as in fib_retracement: from the older of the last swing high and low to the newer. Each level is start plus ratio times (end minus start), so in an up leg the levels lie above the high and in a down leg below the low. leg is +1 for an up leg, -1 for a down leg.
Reference: Fibonacci extension of the last swing leg (#546)
How to read it
The levels move when a new swing is confirmed, length bars after its extreme, and hold until the next one. They are projections, not support or resistance that has been tested; nothing shows before the first swing high and low.
In a strategy
Take profit at a projection: a long opened in an up leg exits at ctx.ind("fib_extension", length=3).level_1618, or in parts at 1.272 and 1.618.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Swing bars each sidelength | Whole number | 3 | min 1, max 50 |
What it draws
| Line | Drawn as |
|---|---|
| 1.272 | Steps |
| 1.618 | Steps |
| 2 | Steps |
| 2.618 | Steps |
Used in
No strategy template reads it yet.