OPEN-SOURCE SCRIPT
Solstice Fibonacci Engine [JOAT]

Solstice Fibonacci Engine [JOAT]
Introduction
The Solstice Fibonacci Engine is a fully automatic Fibonacci retracement and extension tool built for traders who want institutional-grade price levels drawn on their chart without the tedium of manually dragging anchor points. It detects the dominant swing high and swing low within your currently visible chart range, recalculates every time you scroll or zoom, and renders the complete Fibonacci suite — retracements from 0% to 100% and extensions to -100% — in a single, clean overlay.
The engine is purpose-built around two price zones that institutional order flow traders treat as highest-probability areas: the OTE (Optimal Trade Entry) zone from 61.8% to 78.6% retracement, and the Target Zone from -50% to -61.8% extension. These zones are shaded and labeled automatically, with TP1 through TP4 labels placed at the key confluence levels that align with those areas, giving you a ready-made trade management framework the moment any new swing is established.

Core Concepts
Visible Range Swing Detection
Unlike most Fibonacci tools that require manual anchoring or use fixed lookback lengths, Solstice tracks the swing high and swing low within the portion of the chart you are actually looking at:
Pine Script®
When you scroll left or right the swing resets instantly to reflect your new visible window. This makes the tool behave like a dynamic Fibonacci that always measures the most contextually relevant move — the one you are actually analyzing.
Trend Direction from Swing Sequence
The engine determines whether price is in an uptrend or downtrend by comparing the bar index of the swing high against the bar index of the swing low:
Pine Script®
If the swing low came first (left) and the swing high came after (right), price moved up — so retracement levels are drawn from the top down. If the swing high came first, price moved down and levels are drawn from the bottom up. This single boolean drives whether TP1–TP4 labels are placed above or below current price.
OTE Zone — 61.8% to 78.6%
The Optimal Trade Entry zone marks the golden pocket of Fibonacci retracement theory. Price returning into this band after a clean impulsive move often finds the institutional order flow that originally created the swing:
Pine Script®
The zone is rendered as a shaded box extending to the right of the last visible bar, keeping it visible as new bars form. An alert fires on bar close the first time price enters this zone after it was outside it.
Target Zone — -50% to -61.8% Extension
The Target Zone marks the take-profit extension area beyond the 0% level:
Pine Script®
When price has retraced into the OTE and reversed, the -50% to -61.8% extension zone becomes the natural profit target objective — where the move typically exhausts before the next consolidation.
TP1–TP4 Trade Management Labels
Four take-profit labels are placed at the levels that define a complete trade management plan from entry to full profit-taking:
| Label | Level | Meaning |
|-------|-------|---------|
| TP1 | 38.2% | First objective — scalp or partial close |
| TP2 | 0% | Full return to the original swing point |
| TP3 | -27.2% | First extension beyond the swing |
| TP4 | -61.8% | Deep extension — full target zone |
Features

Input Parameters
Main Settings
Fibonacci Levels
Zones and Targets
Visual Settings
Colors
How to Use
Indicator Limitations
Originality Statement
The Solstice Fibonacci Engine is an original Pine Script v6 implementation. Its use of chart.left_visible_bar_time and chart.right_visible_bar_time for dynamic visible-range swing detection is a novel approach that produces a self-adjusting Fibonacci tool with no manual intervention. The OTE and Target Zone framework, TP1–TP4 label system, and scroll-responsive recalculation are original design decisions made specifically for this publication.
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Fibonacci levels are areas of potential price reaction, not certainties. Past Fibonacci confluence does not guarantee future performance. Always use proper risk management and consult a licensed financial professional before trading.
-Made with passion by jackofalltrades
Introduction
The Solstice Fibonacci Engine is a fully automatic Fibonacci retracement and extension tool built for traders who want institutional-grade price levels drawn on their chart without the tedium of manually dragging anchor points. It detects the dominant swing high and swing low within your currently visible chart range, recalculates every time you scroll or zoom, and renders the complete Fibonacci suite — retracements from 0% to 100% and extensions to -100% — in a single, clean overlay.
The engine is purpose-built around two price zones that institutional order flow traders treat as highest-probability areas: the OTE (Optimal Trade Entry) zone from 61.8% to 78.6% retracement, and the Target Zone from -50% to -61.8% extension. These zones are shaded and labeled automatically, with TP1 through TP4 labels placed at the key confluence levels that align with those areas, giving you a ready-made trade management framework the moment any new swing is established.
Core Concepts
Visible Range Swing Detection
Unlike most Fibonacci tools that require manual anchoring or use fixed lookback lengths, Solstice tracks the swing high and swing low within the portion of the chart you are actually looking at:
int visLeft = int(chart.left_visible_bar_time)
int visRight = int(chart.right_visible_bar_time)
bool isVis = time >= visLeft and time <= visRight
if isVis
if na(swHi) or high > swHi
swHi := high
swHiBar := bar_index
if na(swLo) or low < swLo
swLo := low
swLoBar := bar_index
When you scroll left or right the swing resets instantly to reflect your new visible window. This makes the tool behave like a dynamic Fibonacci that always measures the most contextually relevant move — the one you are actually analyzing.
Trend Direction from Swing Sequence
The engine determines whether price is in an uptrend or downtrend by comparing the bar index of the swing high against the bar index of the swing low:
bool trendUp = nz(swLoBar, 0) < nz(swHiBar, 0)
If the swing low came first (left) and the swing high came after (right), price moved up — so retracement levels are drawn from the top down. If the swing high came first, price moved down and levels are drawn from the bottom up. This single boolean drives whether TP1–TP4 labels are placed above or below current price.
OTE Zone — 61.8% to 78.6%
The Optimal Trade Entry zone marks the golden pocket of Fibonacci retracement theory. Price returning into this band after a clean impulsive move often finds the institutional order flow that originally created the swing:
if showOTE
fibZone(color.new(oteClr, 90), 61.8, 78.6, trendUp,
bar_index - 2, lx, swHi, swLo, "OTE ZONE")
The zone is rendered as a shaded box extending to the right of the last visible bar, keeping it visible as new bars form. An alert fires on bar close the first time price enters this zone after it was outside it.
Target Zone — -50% to -61.8% Extension
The Target Zone marks the take-profit extension area beyond the 0% level:
if showTgt
fibZone(color.new(tgtClr, 90), -50.0, -61.8, trendUp,
bar_index - 2, lx, swHi, swLo, "TARGET ZONE")
When price has retraced into the OTE and reversed, the -50% to -61.8% extension zone becomes the natural profit target objective — where the move typically exhausts before the next consolidation.
TP1–TP4 Trade Management Labels
Four take-profit labels are placed at the levels that define a complete trade management plan from entry to full profit-taking:
| Label | Level | Meaning |
|-------|-------|---------|
| TP1 | 38.2% | First objective — scalp or partial close |
| TP2 | 0% | Full return to the original swing point |
| TP3 | -27.2% | First extension beyond the swing |
| TP4 | -61.8% | Deep extension — full target zone |
Features
- Auto swing detection from visible chart range — no manual anchoring required
- Dynamic recalculation on every chart scroll or zoom
- Full Fibonacci suite: 0%, 23.6%, 38.2%, 50%, 61.8%, 70.6%, 78.6%, 100%, -27.2%, -50%, -61.8%, -100%, 150%, 200%
- Per-level toggle switches — show only the levels you want
- OTE Zone (61.8%–78.6%) shaded box with right-extension
- Target Zone (-50% to -61.8%) shaded box with right-extension
- TP1–TP4 labels with optional percentage labels on every level
- Optional swing diagonal line from anchor to anchor
- Dashboard showing swing trend, zone touch status, swing high/low, and range
- Auto dark/light theme detection
- Alerts fire on confirmed bar close when price enters OTE or Target Zone
- Webhook JSON alert format for automation
- Watermark
Input Parameters
Main Settings
- Show All Elements — master toggle for all drawing objects
- Show Swing Diagonal Line — draws a line connecting the two swing anchor points
- Line Width — 1 to 5 pixels
- Line Style — Solid, Dashed, or Dotted
- Label Offset (bars) — how far to the right labels are placed beyond the last bar
Fibonacci Levels
- Individual toggles for each level: 0%, 23.6%, 38.2%, 50%, 61.8%, 70.6%, 78.6%, 100%, -27.2%, -50%, -61.8%, -100%, 150%, 200%
Zones and Targets
- Show OTE Zone — toggles the 61.8%–78.6% shaded box
- Show Target Zone — toggles the -50% to -61.8% shaded box
- Show Zone Labels — text inside zone boxes
- Show TP1–TP4 Labels — take-profit label markers
- Show Level % Labels — percentage text on every drawn level line
Visual Settings
- Theme — Auto (reads chart background), Dark, or Light
- Show Dashboard — compact panel showing current swing readings
- Dashboard Position — Top Left, Top Right, Bottom Left, Bottom Right
- Show Watermark
- Webhook JSON — switches alerts to machine-readable JSON format
Colors
- Fib Lines — color for all retracement/extension level lines
- OTE Zone — fill color for the OTE box
- Target Zone — fill color for the Target Zone box
How to Use
- Add the indicator to any chart on any timeframe — it automatically maps to your current visible range.
- Zoom or scroll your chart to frame the impulsive swing you want to analyze. The Fibonacci grid recalculates to match.
- Look for price to retrace into the OTE Zone (gold band between 61.8% and 78.6%). This is the institutional entry area.
- When price reverses out of the OTE zone, monitor the TP1 label at 38.2% for partial profits, TP2 at 0% for full return to the swing origin, and TP3/TP4 in the Target Zone for extended runners.
- Set the OTE Zone and Target Zone alerts to receive notifications when price enters either area on bar close.
- Enable percentage labels if you need to confirm exact level values for manual entries.
Indicator Limitations
- The swing is determined by the highest high and lowest low within the visible range only — it does not use a structural pivot detection algorithm. On heavily zoomed-out charts, the swing might span an unusually long period.
- Fibonacci levels are mathematical retracements of the detected swing range. They are areas of interest, not guaranteed reversal zones. Always combine with your own confluence analysis.
- The OTE and Target Zone alerts trigger only on the first bar close when price enters the zone from outside. If price exits and re-enters, a new alert fires.
- Retracement drawing regenerates on every bar close at the last bar. On very high-resolution timeframes with large numbers of active objects, this can approach TradingView drawing limits.
Originality Statement
The Solstice Fibonacci Engine is an original Pine Script v6 implementation. Its use of chart.left_visible_bar_time and chart.right_visible_bar_time for dynamic visible-range swing detection is a novel approach that produces a self-adjusting Fibonacci tool with no manual intervention. The OTE and Target Zone framework, TP1–TP4 label system, and scroll-responsive recalculation are original design decisions made specifically for this publication.
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Fibonacci levels are areas of potential price reaction, not certainties. Past Fibonacci confluence does not guarantee future performance. Always use proper risk management and consult a licensed financial professional before trading.
-Made with passion by jackofalltrades
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
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.