Planetary Fan Array [BlueprintResearch]█ Planetary Fan Array automatically detects ZigZag price pivots and draws Gann-style fan angles whose slope is driven by real-time planetary longitude — not fixed geometric ratios. Each time price reverses direction, the indicator anchors a new set of fan lines at the pivot and traces their path using accumulated planetary motion, creating a dynamic framework where the angles evolve with celestial mechanics.
Designed as the pivot-based companion to Price and Longitude Angles , which draws fan lines from a single user-selected anchor point. Use both together: Price and Longitude Angles for static analysis from a key high or low, and Planetary Fan Array for automatic swing-by-swing tracking as new pivots form.
Powered by the open-source Blueprint Ephemeris library (VSOP87D + ELP2000-82 + Meeus) — all planetary positions computed directly in Pine Script, no external data required. Validated against NASA's DE440 ephemeris: all bodies under 0.1° RMS (Sun 0.004°, planets 0.005°–0.017°, Moon 0.062°, Pluto 0.059°).
█ HOW IT WORKS
The indicator combines two independent systems:
1. Pivot Detection
A ZigZag algorithm (via DevLucem/ZigLib) identifies significant highs and lows on price. The "Pivot Sensitivity" control sets the minimum bars between pivots — higher values produce fewer, more significant swings.
2. Longitude-Driven Fan Angles
At each pivot, the indicator begins accumulating planetary longitude (degrees traveled since the pivot). This accumulation is converted to price movement using a configurable $/° (price per degree) ratio, producing diagonal fan lines whose slope reflects actual planetary speed — including natural curves during retrograde motion.
Three fan lines are drawn per swing:
• 1x1 — 1° of longitude = 1 unit of price (on by default, toggleable)
• Ratio 2 — User-selectable (1x8 through 8x1)
• Ratio 3 — User-selectable (1x8 through 8x1)
Fan direction follows the swing: upward swings project fan lines upward from the pivot low, downward swings project downward from the pivot high. Mirror Mode inverts this for resistance/support analysis.
█ FEATURES
Automatic Swing Detection
• ZigZag-based pivot identification with configurable sensitivity, deviation, and backstep
• New fan angles automatically generated at each confirmed pivot
• Up to 30 historical swings preserved with full polyline rendering (Max History: 5–30, default 15)
Three Calculation Modes
• Single — Track one planet's longitude accumulation
• Average — Midpoint of two planets' accumulated longitude
• Synodic — Angular separation between two planets (synodic cycle phase)
12 Celestial Bodies
• ☉ Sun · ☽ Moon · ☿ Mercury · ♀ Venus · 🜨 Earth · ♂ Mars · ♃ Jupiter · ♄ Saturn · ⛢ Uranus · ♆ Neptune · ♇ Pluto
• 🜨 ERA (Earth Rotation Angle) — sidereal time, requires ≤15-minute timeframe
Swing Extensions
• Extend the last 1–3 completed swings to the current bar so prior angles remain visible when a new pivot forms
• Default extends 1 prior swing — you never lose the trend you were tracking
Future Projections
• Project fan lines up to 250 bars into the future from the current bar
• Projections use bar-index positioning for clean rendering on non-continuous markets (stocks, futures, indexes)
• Projected lines maintain the same color and style as historical lines — no visual break at the transition
Curved Polylines
• Fan lines are rendered as polylines that follow the actual longitude path bar by bar
• Natural curvature during retrograde periods — no straight-line approximation
• Optional smooth curves for non-continuous markets
Visual System
• Planet-specific HSV color palette consistent with Price and Longitude Angles
• Optional color overrides for the 1x1 line and ratio lines independently
• Configurable line width (1–5 pixels) applied to all fan lines
• Per-ratio line styles (Solid, Dotted, Dashed) and transparency controls
• Green ▲ and red ▼ pivot markers at detected lows and highs — these are the swing points the indicator builds its fan angles from
• Optional ZigZag connecting line with configurable width
• Info panel showing $/°, mode, planet, degrees traveled, swing direction, and swing count (X/Y where Y is your Max History setting)
• Warning indicator when both user ratios are set to the same value
Alerts
• 1x1 Cross — fires when price crosses the 1x1 fan line
• Ratio 2 Cross — fires when price crosses the second ratio fan line
• Ratio 3 Cross — fires when price crosses the third ratio fan line
• New Pivot — fires when a new pivot is detected and swing direction changes
█ HOW TO USE
1. Add the indicator to your chart. You'll immediately see green ▲ and red ▼ triangle markers on the chart — these mark every detected swing low and swing high. When prompted, click a significant high or low to set your starting point. Fan angles will only be drawn from that point forward.
2. Select your planet(s) in the Planet Selection group. For single-planet analysis, choose your planet as the Primary. For Average or Synodic modes, select both planets.
3. Choose Geocentric (Earth-centered, standard astrology) or Heliocentric (Sun-centered) in the Planet Selection group. Sun and Moon are always geocentric regardless of this setting.
4. Adjust "Price per 1°" to scale the fan angles to your market. Start with 1.0 and increase or decrease until the 1x1 line aligns with meaningful price action. This is the most important calibration step.
5. Set "Pivot Sensitivity" to control how many swings appear. Higher values (30-50) show only major turns; lower values (10-15) catch smaller moves.
6. Choose your two additional fan ratios. The 1x1 is on by default; Ratio 2 and Ratio 3 let you add steeper or shallower angles (e.g., 2x1 for faster price/degree, 1x2 for slower). All three ratios can be toggled independently.
7. Enable Extend Swings (default: 1) to keep the prior swing's angles visible after a new pivot forms.
8. Use future projections to see where fan lines will extend. On non-continuous markets, projections automatically space correctly across market gaps.
9. Check the info panel in the top-right corner. The "Swings" row shows how many completed swings are being tracked out of your Max History limit (e.g., "12/15"). Increase Max History (up to 30) in the Appearance group to keep more swings on screen, or decrease it to reduce visual clutter.
█ WHAT MAKES THIS ORIGINAL
Most planetary angle indicators on TradingView use a single fixed anchor point chosen by the user. This indicator takes a fundamentally different approach: it automatically detects price pivots and generates a new set of longitude-driven fan angles at every swing reversal. The result is a living framework that adapts as the market develops new structure.
Key technical contributions:
• Automatic pivot-to-pivot longitude accumulation — fan angles are driven by actual planetary motion between detected swings, not static geometric construction
• Net displacement through retrograde — longitude accumulates through retrograde motion (allowing negative deltas) rather than clipping to zero, producing smooth fan lines without plateaus
• Polyline-based curved fan rendering — each fan line is a bar-by-bar polyline following the planet's actual path, not a straight line between endpoints
• Global longitude history arrays — planetary positions are stored every bar and reused for extensions, eliminating recalculation discontinuities on non-continuous markets
• Bar-index projection positioning — future projections use bar_index instead of bar_time, preventing vertical line artifacts on non-continuous markets (stocks, futures, indexes during market close)
• Swing extension system — completed swings can be extended to the current bar, preserving visual continuity when new pivots form
• Full VSOP87D + ELP2000-82 + Meeus ephemeris computed in real time — 511 terms (1.6% of full theory) delivering sub-0.1° accuracy against JPL DE440
█ LIMITATIONS & TIPS
• TradingView limits polylines to 100. Each swing uses 3 polylines (one per ratio). With Extend Swings active, keep Max History ≤ 20 to avoid hitting the cap.
• The $/° ratio is market-specific. What works for Bitcoin ($50/°) won't work for ES ($0.50/°). Experiment with the scale to find meaningful alignment.
• ERA (Earth Rotation Angle) rotates ~360°/day — only useful on intraday timeframes ≤15 minutes. A runtime error appears if you select ERA on higher timeframes.
• On non-continuous markets (stocks, futures), the fan line may show a slightly steeper segment across weekend/holiday gaps because the planet moved during market close. This is astronomically accurate — the visual compression is inherent to how non-continuous charts display time.
• For mission-critical timing, always cross-reference with professional tools such as JPL Horizons , Swiss Ephemeris, or Astro.com.
█ COMPANION INDICATOR
• Price and Longitude Angles — The static anchor version. Draw fan lines from any user-selected high or low with 9 Gann ratios (1x8 through 8x1), zodiac bar coloring, aspect table, and cycle counter. Use it for focused analysis of a single key level; use Planetary Fan Array for automatic swing-by-swing coverage.
█ OPEN SOURCE
This indicator is part of the fully open-source Planetary Ephemeris project. The core ephemeris library is publicly available for study, modification, and reuse:
• BlueprintResearch/blueprint_ephemeris_lib — Planetary calculation engine (VSOP87D, ELP2000-82, Meeus)
█ CREDITS & DEPENDENCIES
This indicator is built on top of three exceptional open-source libraries. Without the work of these authors, Planetary Fan Array would not exist.
• Blueprint Ephemeris by @BlueprintResearch — The astronomical engine powering every planetary calculation in this indicator. Computes real-time ecliptic longitude, declination, and speed for all 11 celestial bodies using VSOP87D (planets), ELP2000-82 (Moon), and Meeus algorithms (Pluto) — entirely within Pine Script. Open source (CC BY-SA 4.0).
• ZigLib by @DevLucem — The backbone of all pivot detection in this indicator. Provides the ZigZag algorithm that identifies swing highs and lows, returning precise pivot times and prices that anchor every fan angle. Without ZigLib, there are no swings.
• hsvColor by @kaigouthro — The color system behind the planet-specific HSV palette. Provides HSV color construction and gradient interpolation that gives each celestial body its distinct visual identity. Open source (MPL-2.0).
• Theoretical framework inspired by W.D. Gann's price-time geometry and Patrick Mikula's Gann's Scientific Methods Unveiled , Volume 2, which details the relationship between planetary longitude and price movement.
Pine Script® インジケーター







