QuantiX Fibonacci Retracement
Last modified: 20 February 2025The QuantiX Fibonacci Retracement function is an implementation of Fibonacci retracement. This function returns three set of lines:
last pivots: top and botton
uptrend levels: fibut236, fibut382, fibut500, fibut618, and fibut786
downtrend levels: fibdt236, fibdt382, fibdt500, fibdt618, and fibdt786
The function uses the Pivot function to find pivots in the price and use these pivots to generate a set of Fibonacci retracement levels for an uptrend (fibut236, fibut382, fibut500, fibut618, and fibut786) and a set of Fibonacci retracement levels for a downtrend (fibdt236, fibdt382, fibdt500, fibdt618, and fibdt786). The top and bottom hold the latest high and low pivot, respectively.
The uptrend levels highlight potential resistances in an uptrend after a downtrend. Likewise, The downtrend levels highlight potential supports in a downtrend after an uptrend. In other words, when the last pivot is a low pivot, you should use the uptrend set, and when the last pivot is a high one, you should use the downtrend set.
Note that in an uptrend, uptrend levels are more important and in a downtrend downtrend levels are more important.
The inputs of the function are:
Timeframes: The timeframe(s) in which the function is applied
Look Back Window Length: The number of candles the function considers in the past to find pivots
Confirmation Lag: The number of candles the function waits to confirm a pivot; note that as this parameter becomes larger, the lag of the system also increases, but pivots become more reliable.
High Pivots Source: The source used for finding high pivots
Low Pivots Source: The source used for finding low pivots
Output(s) Column Name(s): The names given to the outputs; the uptrend levels names start with fibut and end with the Fibonacci coefficient the output is associated with. Likewise, the downtrend levels names start with fibdt and end with the Fibonacci coefficient the output is associated with. the top and button hold the last high and low pivot, respectively.
Example
The default settings are used to find Fibonacci retracement levels. In the figure below, the thick black lines are the top and the button. As is seen, they match the last high and low pivot, respectively. The colored lines are downtrend levels calculated by the function, and the colorful region is Fibonacci retracement levels drawn by the Fib Retracement tool in tradingview. As is seen, they match each other.
