Fibonacci Retracement & Extension
Fibonacci retracement and extension price levels of the high-to-low range of recent candles.
Fibonacci levels of the range of period candles that end from candles back: from = 1 (default) uses the previous candles only, the current candle is EXCLUDED; from = 0 includes it. Retracements r = 0.236, 0.382, 0.5, 0.618, 0.786: up_N = retracement of an up move, measured down from the high (high − r × range); down_N = retracement of a down move, measured up from the low (low + r × range). Extensions r = 1.272, 1.618, 2.618: ext_N = extension of an up move above the high (low + r × range, e.g. ext_1618 = the 1.618 extension); ext_down_N = extension of a down move below the low (high − r × range). Ready at period + from candles. Mirror: high ↔ low, up_N ↔ down_N, ext_N ↔ ext_down_N.
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| period | 50 | 2 to 1000 | Candles in the window. |
| from | 1 | 0 to 1000 | Candles back where the window ends (1 = current excluded). |
What it gives
| Output | What it is |
|---|---|
| Range high | Highest high of the window. |
| Range low | Lowest low of the window. |
| 23.6 % retracement from the high | high − 0.236 × (high − low). |
| 38.2 % retracement from the high | high − 0.382 × (high − low). |
| 50 % retracement from the high | high − 0.5 × (high − low). |
| 61.8 % retracement from the high | high − 0.618 × (high − low). |
| 78.6 % retracement from the high | high − 0.786 × (high − low). |
| 23.6 % retracement from the low | low + 0.236 × (high − low). |
| 38.2 % retracement from the low | low + 0.382 × (high − low). |
| 50 % retracement from the low | low + 0.5 × (high − low). |
| 61.8 % retracement from the low | low + 0.618 × (high − low). |
| 78.6 % retracement from the low | low + 0.786 × (high − low). |
| 127.2 % extension above the high | low + 1.272 × (high − low): above the high. |
| 161.8 % extension above the high | low + 1.618 × (high − low): above the high. |
| 261.8 % extension above the high | low + 2.618 × (high − low): above the high. |
| 127.2 % extension below the low | high − 1.272 × (high − low): below the low. |
| 161.8 % extension below the low | high − 1.618 × (high − low): below the low. |
| 261.8 % extension below the low | high − 2.618 × (high − low): below the low. |
What it reads
It reads the whole candle (open, high, low, close and volume).
Warm-up
With its default settings, Fibonacci Retracement & Extension needs 51 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses Fibonacci Retracement & Extension with its default settings