Market Structure: Impulses + Fibonnaci

3 065
Market Structure: Impulses + Fibonnaci
Reads complete impulses at two degrees, anchors Fibonacci to them automatically, validates each move with an intrabar volume profile and liquidity sweep detection, and fires pullback and counter-trend signals from a double MACD.


WHAT IT DOES

A plain ZigZag treats every leg as a separate move, so a Fibonacci anchored to it jumps every time price breathes. This indicator groups legs into impulses: if the retracement from the extreme does not reach the threshold, the opposite leg is treated as an internal pullback and the impulse continues with the same origin. The Fib anchor stays put.

It runs two degrees at the same time:

INTERNAL - the move you trade
• Retracement threshold: 0.382
• Also ends on: structure break
• Drawn as: solid box with label

EXTERNAL - the context that rules
• Retracement threshold: 0.618
• Also ends on: depth only
• Drawn as: dashed grey outline

The structure rule is what stops the internal impulse from growing forever. In a bullish impulse, if a low takes out the previous low, the impulse ended there even if the percentage pullback was small. Without that rule, a stretch without deep corrections ends up anchored at the all-time high.

The extreme extends live while the current leg runs in its favour, so the Fib re-anchors itself. If price breaks the origin, that impulse is dead and the opposite one is born immediately, without waiting for a pivot to confirm.

The dotted gold line labelled 1 and 0 marks the exact two points where you would drop the Fib Retracement tool by hand.

While the recent swings are testing the same two levels rather than trending, a consolidation range box is drawn behind price. Each edge is the median of the last touches, so one wick cannot blow the box out, and the box disappears as soon as the swings stop respecting those levels.


LIQUIDITY, SWEEPS AND BREAKS

A stop-loss is not an alarm, it is a market order waiting. The stop of a long is a sell order, the stop of a short is a buy order. Since everyone uses the same references, sell orders pile up under every swing low and buy orders pile up above every swing high.

That matters because size needs counterparty. To buy a lot you need someone selling a lot, otherwise your own order runs the price away from you. Guaranteed selling sits below the low. So highs and lows behave less like support and resistance and more like fuel depots.

When price crosses one of those levels there are two outcomes, and at first they look identical. That is why the indicator does not decide instantly: it waits for closes.

SWEEP
• After crossing: closes back inside
• Meaning: the level was the destination
• Reading: exhaustion, reversal
• On the chart: SWEEP label

BREAK
• After crossing: closes outside and holds
• Meaning: the level was the path
• Reading: real interest, continuation
• On the chart: no label, the level is consumed

Every confirmed pivot enters a watch list and moves through four states: untouched, pierced (the wick is out, the close is pending), swept, or broken. The "candles to close back" setting is the decision window between pierced and the two outcomes. Default is three candles.

Levels still untouched are drawn dotted and marked liq up or liq down. Orders are still sitting there, and price tends to go looking for them.


VOLUME PROFILE AND ACCEPTANCE

The volume bars at the bottom of a chart are volume per time: how much traded in each candle. A profile is the same volume per price: how much traded at each level, regardless of when. It is the histogram turned ninety degrees.

• POC - the price where most volume traded. Acts as a magnet.
• Value area (VAH-VAL) - the band holding 70% of the volume.
• Fat zone - heavy trade, price slows down and reacts there.
• Thin zone - almost nobody traded, price crosses it fast.

The market is an auction looking for business. When price rises it is asking whether anyone trades up there. If volume trades at the new prices, the market accepts them and the move is a real repricing. If nobody trades and price returns, it was rejection: an excursion, not a change of price.

So the decisive figure is not how much volume there was, but where the POC ended up inside the impulse. The indicator gives it translated into a Fib number, the same scale as everything else: 0 is the extreme, 1 is the origin.

• POC at 0.20 - volume travelled with price. Acceptance, the pullback should hold.
• POC at 0.90 - volume stayed at the origin. No acceptance, the pullback eats the move.

The confluence worth watching: whether the POC line falls inside the shaded 0.618-0.786 zone. If it does, that zone has real support behind it. If the histogram is hollow right there, price crosses without slowing.

The profile is built from intrabar data. Each candle is split into roughly sixteen lower timeframe candles and each of those carries its own volume into its own narrow price band. The cheap alternative — spreading a candle's volume evenly between its high and its low — penalises wide candles and rewards narrow ones, so the base of an impulse concentrates its volume while the rally dilutes its own, dragging the POC towards the origin by construction. On a vertical move that is enough to invert the verdict. Where intrabar history is not available the indicator falls back to the candle itself, and the panel prints the source next to the POC.


THE SIGNALS

Two MACDs drive them. The fast one runs on the chart timeframe and is the trigger. The slow one runs on a higher timeframe — four times the chart by default, read from its last closed bar — and is the permission. The slow MACD counts as bullish by its line above zero, by its line above its signal, or by both, whichever you pick.

Trend (T) - a pullback inside the external impulse.
• The external impulse and the slow MACD must point the same way.
• Price must retrace into the band between the two impulse thresholds: deep enough to be a real pullback, not so deep that the external impulse is over. With the preset in charge that band is 0.382-0.618 on intraday.
• Price must have traded inside that band within the trigger window.
• The fast MACD must then be on the side of the trade.
• One signal per external impulse extreme: once it fires, that pullback is spent.

Counter-trend (CT) - a sweep that fails.
• A pivot is swept: wick outside, close back inside.
• Optionally the fast MACD must diverge from the swept pivot — price takes the level out but the oscillator does not follow.
• That arms the setup for the trigger window. It dies if price pushes past the sweep wick.
• It fires when the fast MACD turns against the sweep and price closes back beyond the swept level.

Every signal carries its own levels. The stop of a trend signal sits beyond the extreme of the pullback, the stop of a counter-trend signal beyond the sweep wick, both with an ATR buffer. The target is a multiple of that risk, two R by default. Entry, stop and target are drawn as lines for the last signal, and the pullback band is shaded while a trend setup is possible.

Signals are evaluated on closed bars only. What the history shows is what the alert would have sent live.

With the webhook option on, every signal also calls alert() with a JSON payload carrying symbol, exchange, side, setup, timeframe, price, stop and target. Create the alert with the "Any alert() function call" condition and paste your webhook URL.


THE PANEL

Three modes.

Signals - the setup in words, six rows:

• Trend - the external impulse and the slow MACD, and whether they agree.
• Trigger - where the fast MACD is pointing right now.
• Setup - what is armed and what it is still waiting for, with the candles left on the trigger window.
• Last signal - which one fired and how long ago.
• Levels - the entry, stop and target of that signal.
• Quality - the acceptance verdict of the impulse the Fib is anchored to.

Full - two data columns, INTERNAL and EXTERNAL, with every metric of both impulses. The header says which of the two the Fibonacci is anchored to.

• Direction - the way each degree is pointing. Both agreeing is a tailwind.
• Origin (fib 1) - where the impulse started. Lower Fib anchor.
• Extreme (fib 0) - the extreme reached. Upper Fib anchor.
• From - date of the origin, so you can replicate it by hand.
• Size / legs - how far it moved and how many legs were merged. Many legs means a mature impulse, closer to its end.
• Max retracement - the deepest correction from the extreme. Close to the threshold means the impulse is in danger.
• State - extending, pullback, or finished.
• Setting - the preset and the values actually in force.
• Extreme swept - whether the extreme was made by taking liquidity. If yes, distrust the whole impulse.
• Impulse POC - where it traded, in price and in Fib terms, with the data source that produced it.
• Verdict - the two above, crossed.

Compact - four icons: EXT and INT direction arrows, a dot for price inside the Fib zone, and the verdict. Hovering any cell brings up the full detail.

The four verdicts:

• ACCEPTANCE - continuation. It neither swept nor lacked business. A pullback into the Fib makes sense with the trend.
• SWEPT - no acceptance. It went for the stops and nothing traded up there. A reversal is the likely outcome.
• Swept but with acceptance. It took liquidity and also built value. Often the good start, but ask for extra confirmation.
• No acceptance - weak. It swept nothing, but nothing traded at the new prices either.

The verdict is informational. It is computed on the last bar and does not feed the signals.


HOW TO READ IT, STEP BY STEP

Everything you need is in the panel, read from top to bottom. Six questions, in this order.

1. What is the context? The EXTERNAL degree. This is the larger move, the one that decides whether you are swimming with the current or against it.

2. Which way is your move going? The INTERNAL degree. Both pointing the same way means the two degrees agree. If they disagree, whatever you are looking at is a pullback inside a bigger move running against it, which leaves less room before the larger degree takes over again.

3. Did the move earn the right to continue? The Verdict row. ACCEPTANCE means the impulse actually traded at its new prices, so a retracement into the Fib is a with-trend read. SWEPT means the extreme was made by running stops and nothing traded up there, so the path back to the origin is more likely than further extension. The two mixed verdicts mean the evidence points both ways: wait for the next pivot rather than pick a side.

4. Where is the retracement likely to hold? Compare the POC line against the shaded zone. POC inside the zone means that area has real volume behind it and price has a reason to react. A hollow histogram there means the opposite: price crosses thin zones quickly, and an order resting in the middle of one usually gets no reaction at all.

5. What kills the read? The gold "impulse ends" line, which sits at the last internal pullback. If price closes through it, the impulse you were reading is finished and the panel will re-anchor. It is a structural level, not a round number, which is what makes it useful as a reference.

6. Where could it go? The dotted liq up and liq down lines are pivots nobody has taken yet. Untaken liquidity attracts price, so they are the natural places for the next move to reach for.

A worked example

The panel reads: EXTERNAL up, INTERNAL up, Verdict ACCEPTANCE, POC at fib 0.66, max retracement 41%.

Both degrees agree, the impulse built volume on its way up, and the POC sits inside the 0.618-0.786 zone. Price has already given back 41% of the move, so it is trading inside that zone right now, on volume that was actually traded there. The gold line below marks where the read stops being valid, and the nearest liq up line above is the first place price would reach for if it continues.

Now change two figures and nothing else: Verdict SWEPT, POC at fib 0.88. Same impulse, same size, same Fib levels drawn on the chart, but the high was made by running stops and all the volume stayed down at the origin. The shaded zone is still drawn, and it is worth nothing, because the move it measures was never accepted.

The rule underneath all of it

Liquidity taken at the START of a move is fuel: the stops that got run financed the move and price left them behind. Liquidity taken at the END was the purpose: the move existed to reach them, and once they are taken there is no reason left to keep going.


SETTINGS

There is one setting that matters. Pick the preset that matches your timeframe and leave everything else alone.

• Scalping (ATR) - ATR 10 x 1.0, internal 0.236, external 0.5. Built for 1m to 15m.
• Intraday (ATR) - ATR 14 x 1.5, internal 0.382, external 0.618. Built for 5m to 4h.
• Swing (%) - 1.5%, internal 0.382, external 0.618. Built for 4h to 1D.
• Position (%) - 4%, internal 0.5, external 0.786. Built for 1D to 1W.

The first number is how far price must reverse before a new pivot is recognised, which sets how much detail the ZigZag sees. The two thresholds are how deep a retracement has to be before an impulse is declared over at each degree: lower numbers break the move into more, smaller impulses; higher numbers merge more legs into fewer, larger ones. They also set the pullback band the trend signals use.

While a preset is selected the manual ZigZag fields and the two thresholds are ignored. Nothing is hidden: the Setting row of the panel always prints the values actually in force, so you can check which calibration is running without opening the dialog. To edit them by hand, switch the preset to Custom.

ATR mode measures that first number in real average ranges instead of a fixed percentage. A fixed percentage punishes quiet sessions with noise pivots and falls short in volatile ones, swallowing whole impulses. With ATR, one setting travels across instruments and across sessions.

One field applies even with a preset selected: "End of internal impulse". It is a reading decision rather than a calibration, so the preset does not overwrite it. Both is recommended, and it ends the impulse on whichever comes first, a deep enough retracement or a broken swing.

The rest of the inputs are grouped by what they draw: ZigZag, impulses, Fibonacci levels, projections, structure levels, sweeps and liquidity, volume profile, panel, and signals.


ALERTS

Twelve conditions. Right-click the chart, choose Add alert, and select this indicator.

Structure:
• New internal impulse - a fresh impulse has been confirmed at the degree you trade.
• Internal impulse finished - the one you were following has ended, by depth or by structure.
• New external impulse - the larger context has changed direction.
• Price in Fib zone - price has just entered the shaded retracement zone.
• New ZigZag pivot - a swing high or low has been confirmed.
• Liquidity sweep - a watched level was pierced by a wick and price closed back inside.

Signals:
• Trend buy / Trend sell - a pullback inside the external impulse, with the slow MACD in agreement.
• Counter-trend buy / Counter-trend sell - a swept pivot that failed, with the fast MACD turning against it.
• Buy (any) / Sell (any) - either setup, for a single alert covering both.


HOW IT BEHAVES, AND WHAT IT CANNOT DO

• Pivots are final once confirmed. A pivot confirms on a bar close and never moves afterwards, so the structure behind you does not repaint. The live extreme does keep updating in real time, which is what lets the Fib re-anchor itself while a leg is still running.

• Pivots can take one extra candle on vertical moves. A pivot is never closed by the same candle that created the extreme. Pine cannot know the order of events inside a bar, so on a bullish candle it cannot assume the low came after the high. Allowing it produced phantom impulses built out of a single candle's own body, so it is blocked deliberately, and the cost is that one extra candle.

• The volume profile is approximate where intrabar history runs out. The intrabar store keeps the most recent bars; beyond it the profile falls back to spreading each candle's volume between its high and its low, and the panel says so next to the POC. The profile is computed on the last bar only, and looks back 900 bars at most, to keep the chart responsive.

• Symbols that report no volume still work. Many FX pairs and some indices publish none at all; the bar range is then used as the effort measure and the panel prints "no-volume" beside the setting in force.

• Drawings are clipped far back. A box or line anchored thousands of bars into the past falls outside the historical buffer Pine can resolve, which would stop the script, so anchors are clamped to a reachable window. An external impulse older than that window has its box clipped on the left, while the panel still shows its true origin in price and date.

• There is no liquidation heatmap. That data does not exist in TradingView, and anything claiming to plot one is estimating it. The liquidity lines here are untaken pivots, which is hard data. A real liquidation map has to be read elsewhere and crossed against this by hand.

• Nothing here is a recommendation. The signals are a mechanical reading of structure, volume and two oscillators. Position sizing, risk and the decision to take a trade are yours.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.