Machine Learning Fibonacci [FEELS]

Where did pullbacks stop on this chart, in legs like the one in play? A Fibonacci grid that answers from the chart's own history.
Draw a fib on a leg and every level is a guess. This script draws the grid on the leg in play, then finds the past legs on the same chart that were most like it: the same direction, a similar size and a similar length. Each of them counts at the fib level where its pullback ended. That level gets a dot and a thicker line, and the level with the most is marked ML LEVEL. The similar past legs are framed on the chart, so you can check every one of them yourself.
What makes it different: an ordinary fib treats 0.382, 0.5 and 0.618 the same. Here the lines are weighted by the chart's own history, and the evidence is on the chart: each past leg the level came from sits in a gold box with where it turned.
SOL/USDT, 1D. The rising leg from the August low. Both similar past legs on screen turned at 0.618, and so did five of the nine. Price is pulling back between 0.382 and 0.5.

FEATURES
- A fib grid on the leg in play, from the leg's start, like the manual fib tool.
- Each fib line weighted by how many similar past legs turned there: one dot per leg, a thicker gold line, grey when none did.
- ML LEVEL on the level where most of them turned.
- The similar past legs framed on the chart: SIMILAR PAST LEG · turned at 0.618. Hover the caption for its rank, size, length and exact depth.
- A legend card that explains the dots, the level and the boxes.
- Exact view as an option: a dot per similar leg at its exact depth, the middle half of them as a zone, their median as the level.
- Three alerts: price reached a level similar legs turned at, price reached the ML level, a new swing point was confirmed.
- Every number, word, colour and position can be changed.
HOW IT WORKS
Swings. A zigzag on closed bars: a swing ends when price moves against it by 4 ATR (ATR 14).
The leg in play. The move from the last swing point. While that move is still smaller than the leg before it, it is treated as that leg's pullback, and the grid stays on the bigger leg.
What it learns from. Every finished leg whose pullback stayed inside the leg, and after which the trend went on past the leg's high or low. Each is remembered with two features, its size in ATR and its length in bars, and one answer: how deep its pullback went, as a fraction of the leg. The last 150 such legs are kept.
The model. k nearest neighbours: the 9 remembered legs closest to the leg in play on those two features, each feature scaled by its spread so neither dominates. By default only legs in the same direction are compared.
The levels. Each of the 9 counts at the fib level nearest to its pullback depth. 1, a full return to the leg's start, counts too, so very deep pullbacks don't all land on 0.786. Each line is drawn as strong as its count, and the level with the most is the ML level.
The level is redrawn as the leg grows, because a bigger or longer leg has different neighbours. Swings and the learning set are decided on closed bars.
BTC/USDT, 1D. The rising leg from the July low. Five of its nine similar past legs turned at 0.5, so 0.5 is the ML level. The one on screen, April to June 2025, turned at 0.382: the votes do not always agree, and the grid shows that.

HOW TO READ IT
1. The grid is a normal fib on the leg in play: 0 at its end, 1 at its start.
2. Each dot next to a number is one similar past leg that turned at that level. Grey levels: none of them did.
3. ML LEVEL is the level with the most dots. Four dots on one level and one on each of the others is a clear answer. Dots spread over every level mean similar legs did not agree, and that is worth knowing too.
4. The gold boxes are those past legs. Zoom out to see the older ones.
5. If the chart doesn't have enough history yet, it says ML is learning and draws the grid only.
UNI/USDT, 1D. The rally from the August low. The two similar legs on screen both turned at 0.786, a deep pullback, and 0.786 is the ML level.

SETTINGS WORTH KNOWING
- A swing ends after a move against it of, × ATR: 4 by default. On calm markets like stock indices, 3 gives more and more recent legs to learn from.
- Similar legs it learns from: 9 by default.
- Legs it remembers: 150 by default. Fewer means the similar legs are more recent and more of them are on screen.
- Learn only from legs in the same direction: on by default. Off compares with rising and falling legs alike.
- Exact view: the raw dots, zone and median instead of the weighted grid.
- Show the similar legs on the chart and Legend: both on by default.
HONESTY
It learns only from pullbacks after which the trend went on. So it shows where pullbacks stopped in the legs that worked out. It does not say whether this pullback will stop at all.
The model is k nearest neighbours on two features. That is machine learning in the plain sense of the words, not a neural network.
Different data feeds of the same market have different history, so the level can differ between them.
Nothing here is a forecast, and the script does not score itself.
Open source. Read it, change it, and tell me if something is wrong.
Draw a fib on a leg and every level is a guess. This script draws the grid on the leg in play, then finds the past legs on the same chart that were most like it: the same direction, a similar size and a similar length. Each of them counts at the fib level where its pullback ended. That level gets a dot and a thicker line, and the level with the most is marked ML LEVEL. The similar past legs are framed on the chart, so you can check every one of them yourself.
What makes it different: an ordinary fib treats 0.382, 0.5 and 0.618 the same. Here the lines are weighted by the chart's own history, and the evidence is on the chart: each past leg the level came from sits in a gold box with where it turned.
SOL/USDT, 1D. The rising leg from the August low. Both similar past legs on screen turned at 0.618, and so did five of the nine. Price is pulling back between 0.382 and 0.5.
FEATURES
- A fib grid on the leg in play, from the leg's start, like the manual fib tool.
- Each fib line weighted by how many similar past legs turned there: one dot per leg, a thicker gold line, grey when none did.
- ML LEVEL on the level where most of them turned.
- The similar past legs framed on the chart: SIMILAR PAST LEG · turned at 0.618. Hover the caption for its rank, size, length and exact depth.
- A legend card that explains the dots, the level and the boxes.
- Exact view as an option: a dot per similar leg at its exact depth, the middle half of them as a zone, their median as the level.
- Three alerts: price reached a level similar legs turned at, price reached the ML level, a new swing point was confirmed.
- Every number, word, colour and position can be changed.
HOW IT WORKS
Swings. A zigzag on closed bars: a swing ends when price moves against it by 4 ATR (ATR 14).
The leg in play. The move from the last swing point. While that move is still smaller than the leg before it, it is treated as that leg's pullback, and the grid stays on the bigger leg.
What it learns from. Every finished leg whose pullback stayed inside the leg, and after which the trend went on past the leg's high or low. Each is remembered with two features, its size in ATR and its length in bars, and one answer: how deep its pullback went, as a fraction of the leg. The last 150 such legs are kept.
The model. k nearest neighbours: the 9 remembered legs closest to the leg in play on those two features, each feature scaled by its spread so neither dominates. By default only legs in the same direction are compared.
The levels. Each of the 9 counts at the fib level nearest to its pullback depth. 1, a full return to the leg's start, counts too, so very deep pullbacks don't all land on 0.786. Each line is drawn as strong as its count, and the level with the most is the ML level.
The level is redrawn as the leg grows, because a bigger or longer leg has different neighbours. Swings and the learning set are decided on closed bars.
BTC/USDT, 1D. The rising leg from the July low. Five of its nine similar past legs turned at 0.5, so 0.5 is the ML level. The one on screen, April to June 2025, turned at 0.382: the votes do not always agree, and the grid shows that.
HOW TO READ IT
1. The grid is a normal fib on the leg in play: 0 at its end, 1 at its start.
2. Each dot next to a number is one similar past leg that turned at that level. Grey levels: none of them did.
3. ML LEVEL is the level with the most dots. Four dots on one level and one on each of the others is a clear answer. Dots spread over every level mean similar legs did not agree, and that is worth knowing too.
4. The gold boxes are those past legs. Zoom out to see the older ones.
5. If the chart doesn't have enough history yet, it says ML is learning and draws the grid only.
UNI/USDT, 1D. The rally from the August low. The two similar legs on screen both turned at 0.786, a deep pullback, and 0.786 is the ML level.
SETTINGS WORTH KNOWING
- A swing ends after a move against it of, × ATR: 4 by default. On calm markets like stock indices, 3 gives more and more recent legs to learn from.
- Similar legs it learns from: 9 by default.
- Legs it remembers: 150 by default. Fewer means the similar legs are more recent and more of them are on screen.
- Learn only from legs in the same direction: on by default. Off compares with rising and falling legs alike.
- Exact view: the raw dots, zone and median instead of the weighted grid.
- Show the similar legs on the chart and Legend: both on by default.
HONESTY
It learns only from pullbacks after which the trend went on. So it shows where pullbacks stopped in the legs that worked out. It does not say whether this pullback will stop at all.
The model is k nearest neighbours on two features. That is machine learning in the plain sense of the words, not a neural network.
Different data feeds of the same market have different history, so the level can differ between them.
Nothing here is a forecast, and the script does not score itself.
Open source. Read it, change it, and tell me if something is wrong.
💰Free Channel — t.me/FeelsStrategy
🤵For more info contact — t.me/VolodymyrFeels
🔗 Links — feelsstrategy.com/links
🤵For more info contact — t.me/VolodymyrFeels
🔗 Links — feelsstrategy.com/links
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
💰Free Channel — t.me/FeelsStrategy
🤵For more info contact — t.me/VolodymyrFeels
🔗 Links — feelsstrategy.com/links
🤵For more info contact — t.me/VolodymyrFeels
🔗 Links — feelsstrategy.com/links
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.