A complete guide to Fibonacci retracements and extensions: the ratios, the calculations and how to check them in TradingView

The lines drawn on a chart at 38.2% or 61.8% — what has been calculated, and how, to produce them? This article organises, for Fibonacci retracements and extensions, where the ratios come from, which two or three points are taken as the input, and the formulas by which the levels are produced.

This article is an organisation of general information, and it does not recommend any particular instrument or transaction. All of the figures dealt with here are synthetic values created for the purpose of explanation, and they are not an actual market. Please make the final decision yourself, after confirming the information you need.

How Fibonacci retracements and extensions differ

Both use Fibonacci ratios, but the way the input is taken, and the place where the levels appear, are different.

A comparison of the input points, what is measured, and the main ratios for retracements and extensions
A retracement measures the depth inside the range; an extension measures candidate levels outside it.View the image enlarged (original size 1672×941)

What is called an extension comes in two methods: one that extends outward from two points, and one that projects using three points. Because the inputs of these two differ, specifying the same ratio produces different figures. If they are confused, the figures cannot be reproduced. They are dealt with separately in the section on the formulas below.

Schematic diagram showing where, for an up swing with a low of 100 and a high of 160, 145.84 at 23.6 per cent, 137.08 at 38.2 per cent, 130.00 at 50 per cent, 122.92 at 61.8 per cent and 112.84 at 78.6 per cent line up on the price axis. Only 50 per cent is drawn as a broken line, to show that its derivation is different
The relative positions of the five candidate pullback levels for the synthetic values L=100 and H=160 (a range of 60)

The Fibonacci sequence and the main ratios

The definition of the sequence itself

The Fibonacci sequence is a sequence in which the sum of the preceding two terms becomes the next term. Because there are different conventions for how the initial terms are taken, the term numbers shift unless the convention is stated. This article uses the following definition.

F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2)
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, ...

This definition and this sequence can be referred to as A000045 in OEIS, the public database of integer sequences. The definition of the sequence is a mathematical fact, but it does not show that the sequence is effective in the market. These two are separate matters.

Where the main ratios come from

The ratios used in charting tools are derived from the value to which the ratio of adjacent terms of this sequence converges (the reciprocal of the golden ratio φ = 0.6180339887…).

RatioDerivationRelationship to the sequence
23.6%0.618 cubed ≒ 0.236Derived from φ
38.2%0.618 squared ≒ 0.382 (the limit of the ratio of terms two places apart)Derived from φ
61.8%The limit of the adjacent ratio F(n) ÷ F(n+1)Derived from φ
78.6%The square root of 0.618 ≒ 0.786Derived from φ
127.2%The reciprocal of 0.786 ≒ 1.272 (= the square root of 1.618)Derived from φ
161.8%The limit of the adjacent ratio F(n+1) ÷ F(n)Derived from φ
261.8%1.618 squared ≒ 2.618Derived from φ
50%Not included in any of the derivations aboveDescribed below

Where 50% stands

50% belongs to a different family of derivation from the other ratios. This point needs to be stated accurately.

It is often said that 50% is not a Fibonacci ratio, but if that is meant in the sense that it never appears as a ratio of the sequence, it is not correct. Writing the sequence out according to the definition, F(2) ÷ F(3) = 1 ÷ 2 = 0.5 does appear exactly.

Stated accurately, the position is as follows.

In other words, 50% is a level that is lined up by convention, because half of the range is easy to grasp, and its origin differs from that of the other four. Because the tools line it up as a line that looks the same as the others, the difference in origin cannot be seen from the screen.

The relationship between the Fibonacci sequence, the golden ratio and the main ratios
The ratios are not probabilities of a reversal; they are a scale for measuring candidate positions.View the image enlarged (original size 1672×941)

The formulas for retracements

Let the two points be L (the low) and H (the high), and let the range be D = H - L. The ratio is written as r. The formula changes according to the direction.

Candidate pullback levels in an up swing (measured downward from the high)   Level = H - r × D
Candidate rebound levels in a down swing (measured upward from the low)      Level = L + r × D

Even with the same L, the same H and the same r, the result changes according to which formula was used. In the tools this often corresponds to which of the two points was clicked first, so the order of the operation may be what decides the choice of formula.

The ratio can also be worked back from the level. For an up swing it is r = (H - level) ÷ D. This can be used when checking what percentage a displayed figure corresponds to.

The formulas for extensions

Where the two points are extended outward

The same two points as for a retracement are used, and the ratio is taken as greater than 1.0.

Level = L + e × D        (e is 1.272, 1.618, 2.618 and so on)

Where three points are projected

Three points are taken — A (the starting point), B (the end point of the range) and C (the reference point for the projection) — and the range from A to B is measured from C.

Level = C + e × (B - A)

These two are different things. Even when the same 161.8% is specified, with the synthetic values A=100, B=160, C=130 they divide as follows.

MethodFormulaThe 161.8% level
Two-point outer100 + 1.618 × 60197.08
Three-point projection130 + 1.618 × 60227.08

The difference of 30.00 is exactly the difference between the third point C (130) and L (100). Unless a record is kept of which method was used, and of which points were taken as A / B / C, the same figures cannot be reproduced.

A comparison chart placing side by side, on the left, a diagram of the two-point outer method, which from a low of 100 and a high of 160 calculates 176.32, 197.08 and 257.08 as 100 plus the coefficient times 60, and on the right, a diagram of the three-point projection method, which from the third point of 130 calculates 206.32, 227.08 and 287.08 as 130 plus the coefficient times 60, showing that the same 161.8 per cent divides into 197.08 and 227.08
The two-point outer levels and the three-point projection take different inputs, so the same ratio gives a different result

Checking worked examples on synthetic prices

All of the following are synthetic values. They are not an actual market. Let L = 100 and H = 160, and therefore D = 60.

Candidate pullback levels in an up swing (H − r × D)

RatioCalculationLevel
23.6%160 − 0.236 × 60145.84
38.2%160 − 0.382 × 60137.08
50%160 − 0.5 × 60130.00
61.8%160 − 0.618 × 60122.92
78.6%160 − 0.786 × 60112.84

Candidate rebound levels in a down swing (L + r × D)

RatioCalculationLevel
23.6%100 + 0.236 × 60114.16
38.2%100 + 0.382 × 60122.92
50%100 + 0.5 × 60130.00
61.8%100 + 0.618 × 60137.08
78.6%100 + 0.786 × 60147.16

The figures look as though they have been swapped between the upward and the downward case, but it is only that the same positions are being measured from a different direction. For example, 122.92 corresponds to 61.8% in the up swing and to 38.2% in the down swing. Saying only that something is the 61.8% level does not fix the position, unless it is known which way round the measurement was taken.

Three-point projection (C + e × (B − A))

A = 100, B = 160, C = 130, and the range that serves as the base is B − A = 60.

RatioCalculationLevel
127.2%130 + 1.272 × 60206.32
161.8%130 + 1.618 × 60227.08
261.8%130 + 2.618 × 60287.08

How rounding is handled

All of the values in the tables above divide exactly, but in practice fractional amounts arise. Rounding should be applied only at the end, and not part-way through the calculation. If it is applied part-way, the error accumulates as the number of stages increases. Once the number of digits to be displayed has been decided, that number of digits should be kept uniform throughout the article or the record.

An example record keeping the time frame, the swing concerned, the high and the low, the price series, the ratios and the rounding
Because the levels change if the anchors differ even at the same ratio, the inputs are recorded.View the image enlarged (original size 1672×941)

How to record the high and the low used as anchors

The formulas themselves are simple, but which high and which low are taken is not determined automatically. This is where discretion enters.

For the same high of 160, the 61.8% level changes as follows according to whether the low is taken as 100 or as 130.

AnchorsRange DThe 61.8% level
Long-term (100 → 160)60122.92
Short-term (130 → 160)30141.46

The difference of 18.54 arises purely from the difference in the range. The ratio is the same 61.8%.

Schematic diagram showing that, for a common high of 160, taking the long-term low anchor of 100 puts 61.8 per cent at 122.92 while taking the short-term low anchor of 130 puts it at 141.46, and that the difference of 18.54 arises purely from the difference between a range of 60 and a range of 30
Even at the same ratio, the levels change with the way the anchors are taken

For that reason, at least the following should be kept on record when a level is recorded.

Unless these are kept, the lines you drew cannot be verified afterwards. A memory that it was 61.8% at the time is not enough, on its own, to fix the value uniquely.

Why the display changes with rises, falls and the time frame

The causes of a change in the display divide broadly into three.

  1. The direction: according to which of H - r × D and L + r × D is used, the label for the same ratio is attached to a different position
  2. The anchors: because changing the time frame changes which highs and lows are visible, the same procedure ends up selecting different points
  3. The setting of the price axis: according to whether the price axis is linear or logarithmic, the way the range is measured changes. On a logarithmic axis the division is by ratio rather than by price difference, so the levels do not agree with those on a linear axis

The third is a point that is readily overlooked. Even with the same tool, the same instrument and the same anchors, the figures may change if the setting of the axis differs.

Examples of how the display of the same ratio changes with the rise or the fall, the time frame and whether the axis is logarithmic
Differences in the levels arise less from the ratio than from differences in the direction, the anchors and the time frame.View the image enlarged (original size 1672×941)

The range of operations that can be confirmed in TradingView

What follows is an explanation confined to the range that can be confirmed in the official help published by the provider. Because the names, the layout and the initial values on the screen may change, please confirm them on the actual screen. This article does not recommend the use of any particular tool.

What is explained in the official help is broadly as follows.

The range of functions available, the initial values and the positions on the screen may differ according to the plan and to the period of provision. Please do not fill in, by conjecture, behaviour that is not written here; confirm it on the screen you are using and in the official help. The help pages referred to are listed at the end of this article.

Where it does not work, and its limits

Frequently checked questions

What is the difference between a Fibonacci retracement and an extension?

A retracement divides the inside of the range between two points, while an extension produces levels outside the range, or as a projection from a third point. The number of input points, and the position where the levels appear, are different.

Is 50% a Fibonacci ratio?

Whereas the other main ratios are derived from the golden ratio, 50% is not included in that family of derivation. F(2) ÷ F(3) = 0.5 does appear exactly among the initial terms of the sequence, but this is a coincidence, and what the adjacent ratio approaches is 0.618…. 50% is a level that is lined up by convention, because half of the range is easy to grasp.

Why does the figure differ from one person to another even at the same 61.8%?

Because where the high and the low were taken — the anchors — is different. Even with the same high of 160, taking the low as 100 gives 122.92, and taking it as 130 gives 141.46. What differs is not the ratio but the range.

Why does the formula change between a rise and a fall?

Because the direction of measurement is reversed. In an up swing the measurement is taken downward from the high, and in a down swing upward from the low. Even for the same position, the percentage on the label changes according to which end it is measured from.

The figures for the extension differ from what I expected

The method that extends outward from two points and the method that projects three points may have been mistaken for each other. With the synthetic values A=100, B=160 and C=130, the same 161.8% divides into 197.08 and 227.08.

Do the levels change if I use a logarithmic axis?

They may change. On a logarithmic axis the division is by ratio rather than by price difference, so the figures are not the same as on a linear axis. Please record which of the two the calculation was made on.

Will the price reverse at this level?

That is not known. What the calculation produces is only a position; it does not indicate what will happen there. Even if there are past instances where the price rebounded at a nearby position, that does not indicate a future result.

Summary

This article is an organisation of general information. It does not recommend any particular instrument or transaction, nor is it advice tailored to individual circumstances. Please make the final decision yourself.

Official information referred to

The definition of the sequence is a mathematical fact, and it does not indicate effectiveness in the market.

The provider’s help pages referred to (product specifications)

The following are the provider’s help pages referred to for the explanation of the functions and operations on the screen. They are not used as a basis for financial facts. Product specifications may change.

Always check the latest trading conditions, fees and campaigns on each company’s official site. The information on this page is as at the time it was written.