Market Structure + Fibonacci
Combines market structure detection with automatic Fibonacci placement. Fibs are drawn from confirmed swing highs to lows, giving you institutional-level retracement zones without manual drawing.

What's Included
How Market Structure + Fibonacci works
This concept combines two ideas traders rely on constantly: market structure and Fibonacci retracement. Rather than dragging Fib levels manually, the retracement is anchored to confirmed structural swings, most commonly from a validated swing high to a swing low (or the reverse), so the levels are tied to a real leg of the move instead of an arbitrary hand-picked range.
Once the swing is defined, the standard retracement levels are projected across it, dividing the range into meaningful zones. Practitioners split that range into premium (the upper portion, generally seen as expensive) and discount (the lower portion, generally seen as cheap), which frames whether the current price offers a favourable location to buy or sell relative to the swing.
The area many traders focus on is the Optimal Trade Entry zone, a specific band within the deeper part of the retracement where price often pulls back before continuing in the direction of the prior structure. Highlighting that OTE zone gives a repeatable location to look for entries, though it always needs confirmation because retracements can extend or fail.
When to use it
- Finding pullback entries within a trend by waiting for price to reach a discount or premium zone in line with structure.
- Framing whether current price is expensive or cheap relative to the most recent confirmed swing.
- Focusing attention on the OTE zone as a repeatable area to hunt for continuation setups.
- Keeping retracements objective by anchoring them to confirmed structure rather than eyeballing swings.
When it's not the right tool
- In a market without clear structure, where swings are ambiguous and the retracement has no reliable anchor.
- As an automatic entry trigger, since price can slice straight through Fib levels when a trend reverses.
- During strong impulsive breakouts that barely retrace, where waiting for a deep pullback means missing the move.
Source Code Preview
Get the full PineScript v6 source code—use it as a foundation and build on top of it with HorizonAI.
Frequently asked questions
What are premium and discount zones?
They split a structural swing into an upper 'expensive' half and a lower 'cheap' half. The idea is to prefer buying in discount and selling in premium relative to the swing, so you are entering at a more favourable location within the range rather than chasing.
What is the OTE zone?
The Optimal Trade Entry is a band inside the deeper part of the retracement where price frequently reacts before continuing with the prior structure. It gives traders a consistent area to look for entries, but it still requires confirmation because not every pullback respects it.
Why anchor Fibs to confirmed structure instead of drawing them manually?
Manual placement is subjective and easy to bias toward the outcome you want. Anchoring to a confirmed swing high and low keeps the levels tied to an actual leg of the move, making the premium, discount and OTE reads more objective and repeatable.
Do Fibonacci levels always hold?
No. They mark areas of statistical interest, not guaranteed reversal points, and price can push through any level. Use them as decision zones alongside structure and risk management rather than as certainties, and remember nothing here is financial advice.
Get access to all 23+ scripts
Full source code, alert templates, and the perfect base to build on with HorizonAI. Join 10,000+ traders.


