lib_ephemeris █ PLANETARY EPHEMERIS MASTER LIBRARY
Unified API for calculating planetary positions. Import this single library to access all 11 celestial bodies: Sun, Moon, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Theory: VSOP87 (planets), ELP2000-82 (Moon), Meeus (Pluto)
═══════════════════════════════════════════════════════════════
█ QUICK START
//@version=6
indicator("Planetary Ephemeris Demo")
import BlueprintResearch/lib_ephemeris/1 as eph
// Get all planets
sun = eph.string_to_planet("Sun")
moon = eph.string_to_planet("Moon")
mercury = eph.string_to_planet("Mercury")
venus = eph.string_to_planet("Venus")
mars = eph.string_to_planet("Mars")
jupiter = eph.string_to_planet("Jupiter")
saturn = eph.string_to_planet("Saturn")
uranus = eph.string_to_planet("Uranus")
neptune = eph.string_to_planet("Neptune")
pluto = eph.string_to_planet("Pluto")
// Get longitude for each planet (geocentric)
sun_lon = eph.get_longitude(sun, time, true)
moon_lon = eph.get_longitude(moon, time, true)
mercury_lon = eph.get_longitude(mercury, time, true)
venus_lon = eph.get_longitude(venus, time, true)
mars_lon = eph.get_longitude(mars, time, true)
jupiter_lon = eph.get_longitude(jupiter, time, true)
saturn_lon = eph.get_longitude(saturn, time, true)
uranus_lon = eph.get_longitude(uranus, time, true)
neptune_lon = eph.get_longitude(neptune, time, true)
pluto_lon = eph.get_longitude(pluto, time, true)
// Plot all planets
plot(sun_lon, "Sun", color.yellow)
plot(moon_lon, "Moon", color.silver)
plot(mercury_lon, "Mercury", color.orange)
plot(venus_lon, "Venus", color.green)
plot(mars_lon, "Mars", color.red)
plot(jupiter_lon, "Jupiter", color.purple)
plot(saturn_lon, "Saturn", color.olive)
plot(uranus_lon, "Uranus", color.aqua)
plot(neptune_lon, "Neptune", color.blue)
plot(pluto_lon, "Pluto", color.gray)
═══════════════════════════════════════════════════════════════
█ AVAILABLE FUNCTIONS
Core Data Access:
• string_to_planet(string) → Planet enum
• get_longitude(Planet, time, preferGeo) → degrees [0, 360)
• get_declination(Planet, time) → degrees
• get_speed(Planet, time) → degrees/day
• is_retrograde(Planet, time) → true/false
Planetary Averages:
• get_avg6_geo_lon(time) → 6 outer planets average
• get_avg6_helio_lon(time)
• get_avg8_geo_lon(time) → 8 classical planets average
• get_avg8_helio_lon(time)
Utility:
• normalizeLongitude(lon) → normalize to [0, 360)
═══════════════════════════════════════════════════════════════
█ SUPPORTED PLANET STRINGS
Works with symbols or plain names (case-insensitive):
• "☉︎ Sun" or "Sun"
• "☽︎ Moon" or "Moon"
• "☿ Mercury" or "Mercury"
• "♀ Venus" or "Venus"
• "🜨 Earth" or "Earth"
• "♂ Mars" or "Mars"
• "♃ Jupiter" or "Jupiter"
• "♄ Saturn" or "Saturn"
• "⛢ Uranus" or "Uranus"
• "♆ Neptune" or "Neptune"
• "♇ Pluto" or "Pluto"
═══════════════════════════════════════════════════════════════
█ COORDINATE SYSTEMS
Geocentric: Positions relative to Earth (default for Sun/Moon)
Heliocentric: Positions relative to the Sun
Use the preferGeo parameter in get_longitude():
• true = geocentric
• false = heliocentric
Sun and Moon always return geocentric (heliocentric not applicable).
═══════════════════════════════════════════════════════════════
█ FUTURE PROJECTIONS
Project planetary positions into the future using polylines:
import BlueprintResearch/lib_vsop_core/1 as core
// Get future timestamp (250 bars ahead)
future_time = core.get_future_time(time, 250)
// Calculate future position
future_lon = eph.get_longitude(mars, future_time, true)
Use with polyline.new() to draw projected paths on your chart. See the commented showcase code in this library's source for a complete 250-bar projection example.
═══════════════════════════════════════════════════════════════
█ OPEN SOURCE
This library is part of an open-source planetary ephemeris project.
Free to use with attribution. MIT License.
═══════════════════════════════════════════════════════════════
█ REFERENCES
• Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
• Bretagnon & Francou. "VSOP87 Solutions" (1988)
• Chapront-Touzé & Chapront. "ELP2000-82" (1983)
═══════════════════════════════════════════════════════════════
© 2025 BlueprintResearch (Javonnii) • MIT License
@version=6
normalizeLongitude(lon)
Normalizes any longitude value to the range [0, 360) degrees.
Parameters:
lon (float) : (float) Longitude in degrees (can be any value, including negative or >360).
Returns: (float) Normalized longitude in range [0, 360).
string_to_planet(planetStr)
Converts a planet string identifier to Planet enum value.
Parameters:
planetStr (string) : (string) Planet name (case-insensitive). Supports formats: "Sun", "☉︎ Sun", "sun", "SUN"
Returns: (Planet) Corresponding Planet enum. Returns Planet.Sun if string not recognized.
@note Supported planet strings: Sun, Moon, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto
get_longitude(p, t, preferGeo)
Returns planetary longitude with automatic coordinate system selection.
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
preferGeo (bool) : (bool) If true, return geocentric; if false, return heliocentric.
Returns: (float) Longitude in degrees, normalized to range [0, 360).
@note Sun and Moon always return geocentric regardless of preference (heliocentric not applicable).
get_declination(p, t)
Returns planetary geocentric equatorial declination.
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
Returns: (float) Geocentric declination in degrees, range where positive is north.
@note Declination is always geocentric (no heliocentric equivalent in library).
get_speed(p, t)
Returns planetary geocentric longitude speed (rate of change).
Parameters:
p (series Planet) : (Planet) Planet to query.
t (float) : (float) Unix timestamp in milliseconds (use built-in 'time' variable).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion. Returns na for Moon.
@note Speed is always geocentric (no heliocentric equivalent in library). Moon speed calculation not implemented.
get_avg6_geo_lon(t)
get_avg6_geo_lon
@description Returns the arithmetic average of the geocentric longitudes for the six outer planets: Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average geocentric longitude of the six outer planets in degrees, range [0, 360).
get_avg6_helio_lon(t)
get_avg6_helio_lon
@description Returns the arithmetic average of the heliocentric longitudes for the six outer planets: Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average heliocentric longitude of the six outer planets in degrees, range [0, 360).
get_avg8_geo_lon(t)
get_avg8_geo_lon
@description Returns the arithmetic average of the geocentric longitudes for all eight classical planets: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average geocentric longitude of all eight classical planets in degrees, range [0, 360).
get_avg8_helio_lon(t)
get_avg8_helio_lon
@description Returns the arithmetic average of the heliocentric longitudes for all eight classical planets: Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, and Pluto.
Parameters:
t (float) : (float) Time in Unix timestamp (milliseconds).
Returns: (float) Average heliocentric longitude of all eight classical planets in degrees, range [0, 360).
is_retrograde(p, t)
Returns true if the planet is currently in retrograde motion (geocentric speed < 0) == 0 = stationary.
Parameters:
p (series Planet) : The planet to check.
t (float) : Time in Unix timestamp (milliseconds).
Returns: true if the planet is in retrograde, false otherwise.
Astronomy
lib_vsop87_mercuryLibrary "lib_vsop87_mercury"
Heliocentric and geocentric position calculations for Mercury
using VSOP87 theory. Provides longitude, latitude, radius, speed,
and declination functions.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory VSOP87A (Heliocentric rectangular coordinates)
@accuracy Truncated series (~10-15 terms per series) - arcsecond precision
@time_scale Julian millennia from J2000.0 (use core.get_julian_millennia)
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
Bretagnon & Francou. "VSOP87 Solutions" (1988)
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Mercury data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
import BlueprintResearch/lib_vsop_core/1 as core
get_helio_lon(t)
Computes Mercury's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Mercury's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Mercury's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 0.31-0.47 AU.
get_geo_speed(t)
Computes Mercury's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Mercury's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Mercury's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Mercury's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_vsop87_venusLibrary "lib_vsop87_venus"
Heliocentric and geocentric position calculations for Venus
using VSOP87 theory. Provides longitude, latitude, radius, speed,
and declination functions.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory VSOP87A (Heliocentric rectangular coordinates)
@accuracy Truncated series (~10-15 terms per series) - arcsecond precision
@time_scale Julian millennia from J2000.0 (use core.get_julian_millennia)
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
Bretagnon & Francou. "VSOP87 Solutions" (1988)
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Venus data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
import BlueprintResearch/lib_vsop_core/1 as core
get_helio_lon(t)
Computes Venus's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Venus's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Venus's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 0.72-0.73 AU.
get_geo_speed(t)
Computes Venus's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Venus's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Venus's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Venus's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_elp2000_moonLibrary "lib_elp2000_moon"
get_geo_ecl_lon(T)
Parameters:
T (float)
get_geo_ecl_lat(T)
Parameters:
T (float)
get_obliquity(T)
Parameters:
T (float)
get_declination(T)
Parameters:
T (float)
get_true_node_lon(T)
Parameters:
T (float)
get_true_south_node_lon(T)
Parameters:
T (float)
get_node_declination(T)
Parameters:
T (float)
get_south_node_declination(T)
Parameters:
T (float)
lib_vsop87_marsLibrary "lib_vsop87_mars"
get_helio_lon(t)
Computes Mars's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Mars's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Mars's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 1.38-1.67 AU.
get_geo_speed(t)
Computes Mars's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Mars's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Mars's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Mars's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_vsop87_jupiterLibrary "lib_vsop87_jupiter"
get_helio_lon(t)
Computes Jupiter's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Jupiter's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Jupiter's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 4.95-5.46 AU.
get_geo_speed(t)
Computes Jupiter's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Jupiter's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Jupiter's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Jupiter's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_vsop87_saturnLibrary "lib_vsop87_saturn"
get_helio_lon(t)
Computes Saturn's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Saturn's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Saturn's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 9.02-10.05 AU.
get_geo_speed(t)
Computes Saturn's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Saturn's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Saturn's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Saturn's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_vsop87_uranusLibrary "lib_vsop87_uranus"
Heliocentric and geocentric position calculations for Uranus
using VSOP87 theory. Provides longitude, latitude, radius, speed,
and declination functions.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory VSOP87A (Heliocentric rectangular coordinates)
@accuracy Truncated series (~10-15 terms per series) - arcsecond precision
@time_scale Julian millennia from J2000.0 (use core.get_julian_millennia)
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
Bretagnon & Francou. "VSOP87 Solutions" (1988)
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Uranus data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
import BlueprintResearch/lib_vsop_core/1 as core
get_helio_lon(t)
Computes Uranus's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Uranus's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Uranus's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 18.28-20.09 AU.
get_geo_speed(t)
Computes Uranus's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Uranus's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Uranus's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Uranus's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_vsop87_neptuneLibrary "lib_vsop87_neptune"
Heliocentric and geocentric position calculations for Neptune
using VSOP87 theory. Provides longitude, latitude, radius, speed,
and declination functions.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory VSOP87A (Heliocentric rectangular coordinates)
@accuracy Truncated series (~10-15 terms per series) - arcsecond precision
@time_scale Julian millennia from J2000.0 (use core.get_julian_millennia)
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
Bretagnon & Francou. "VSOP87 Solutions" (1988)
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Neptune data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
import BlueprintResearch/lib_vsop_core/1 as core
get_helio_lon(t)
Computes Neptune's heliocentric ecliptic longitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_helio_lat(t)
Computes Neptune's heliocentric ecliptic latitude using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric ecliptic latitude in radians, range approximately . Note: Returns radians, not degrees.
get_helio_radius(t)
Computes Neptune's heliocentric radius (distance from Sun) using VSOP87 theory.
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 29.81-30.33 AU.
get_geo_speed(t)
Computes Neptune's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
get_geo_lon(t)
Computes Neptune's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Neptune's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Neptune's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian millennia from J2000.0 (use core.get_julian_millennia(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
lib_meeus_plutoLibrary "lib_meeus_pluto"
Heliocentric and geocentric position calculations for Pluto using
Meeus truncated analytical series. Valid ±1 century from J2000.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory Meeus truncated series (not full planetary theory)
@accuracy Arcminute precision within ±1 century of J2000
@time_scale Julian centuries from J2000.0 (use core.get_julian_centuries)
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998), Chapter 37
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Pluto data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
import BlueprintResearch/lib_vsop_core/1 as core
get_helio_lon(t)
Computes Pluto's heliocentric ecliptic longitude using Meeus truncated analytical series.
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Heliocentric ecliptic longitude in degrees, normalized to range [0, 360). Accurate within ±1 century from J2000.
get_helio_lat(t)
Computes Pluto's heliocentric ecliptic latitude using Meeus truncated analytical series.
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Heliocentric ecliptic latitude in degrees, range approximately . Accurate within ±1 century from J2000.
get_helio_radius(t)
Computes Pluto's heliocentric radius (distance from Sun) using Meeus truncated analytical series.
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Heliocentric radius in astronomical units (AU). Typical range is 29.6-49.3 AU. Accurate within ±1 century from J2000.
get_geo_lon(t)
Computes Pluto's geocentric ecliptic longitude (as seen from Earth).
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Geocentric ecliptic longitude in degrees, normalized to range [0, 360).
get_geo_ecl_lat(t)
Computes Pluto's geocentric ecliptic latitude (as seen from Earth).
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Geocentric ecliptic latitude in degrees, range approximately .
get_geo_decl(t)
Computes Pluto's geocentric equatorial declination (as seen from Earth).
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Geocentric equatorial declination in degrees, range where positive is north.
get_geo_speed(t)
Computes Pluto's geocentric longitude speed (rate of change over time).
Parameters:
t (float) : (float) Julian centuries from J2000.0 (use core.get_julian_centuries(time)).
Returns: (float) Geocentric longitude speed in degrees per day. Negative values indicate retrograde motion (apparent backward movement).
lib_vsop_coreLibrary "lib_vsop_core"
Foundation library providing core types, evaluators, and utilities
for VSOP87 planetary theory calculations. Required by all planetary
libraries. Includes Earth heliocentric model and Sun geocentric functions.
@author BlueprintResearch (Javonnii)
@license MIT License - Free to use with attribution
@theory VSOP87 (Variations Séculaires des Orbites Planétaires)
@accuracy Truncated series - suitable for financial astrology and education
@time_scale Julian millennia from J2000.0 for VSOP87 planets
Julian centuries from J2000.0 for Moon and Pluto
@reference Meeus, Jean. "Astronomical Algorithms" (2nd Ed., 1998)
Bretagnon & Francou. "VSOP87 Solutions" (1988)
@showcase Includes commented showcase code with 250-bar future projection.
Uncomment to display Sun/Earth data with polyline projections.
@open_source This library is part of an open-source alternative to
proprietary astronomical libraries. Study, modify, and
share freely. We believe knowledge of the cosmos belongs
to everyone.
════════════════════════════════════════════════════════════════
© 2025 BlueprintResearch / Javonnii
Licensed under MIT License
════════════════════════════════════════════════════════════════
@version=6
get_julian_millennia(time_)
Parameters:
time_ (float)
get_julian_centuries(time_)
Parameters:
time_ (float)
eval_vsop87(terms, t)
Parameters:
terms (array)
t (float)
eval_vsop87_derivative(terms, t)
Parameters:
terms (array)
t (float)
mod360(x)
Parameters:
x (float)
custom_atan2(y, x)
Parameters:
y (float)
x (float)
get_earth_helio_radius(t)
Parameters:
t (float)
get_earth_helio_coords(t)
Parameters:
t (float)
get_obliquity(t)
Parameters:
t (float)
get_earth_helio_lon(t)
Parameters:
t (float)
get_sun_geo_lon(t)
Parameters:
t (float)
get_sun_geo_speed(t)
Parameters:
t (float)
get_sun_decl(t)
Parameters:
t (float)
get_bar_gap_ms()
Get bar interval in milliseconds for current timeframe
Returns: (int) Time interval between bars in milliseconds
get_future_time(current_time, bars_ahead)
Calculate future timestamp for projection plotting
Parameters:
current_time (int) : (int) Current bar time in milliseconds (use built-in 'time')
bars_ahead (int) : (int) Number of bars to project into future
Returns: (int) Future timestamp suitable for xloc.bar_time and chart.point.from_time
is_projection_bar()
Check if current bar is suitable for drawing future projections
Returns: (bool) True on last bar when projections should be drawn
vsop_term
Fields:
amp (series float)
phase (series float)
freq (series float)
Lunar Cycle Tracker - (Moon + 3 Mercury Retrogrades)This script overlays the lunar and Mercury retrograde cycles directly onto your chart, helping traders visualize natural timing intervals that may influence market behavior.
Key Features:
🌑 New Moon & Full Moon Markers:
Vertical lines and labels indicate new and full moon events each month. You can fully customize their colors.
🌗 Last Quarter Moon Fill:
A soft pink background highlights the last quarter moon phase (from 7.4 days after the full moon to the next new moon).
🪐 Three Mercury Retrograde Zones:
Highlight up to three retrograde periods per year with customizable date inputs and background color. Great for spotting potential reversal or volatility windows.
Customization:
Moon event dates and colors
Manual input for Mercury retrograde periods (year, month, day)
Full compatibility with all timeframes (1H, 4H, daily, etc.)
Great for astro-cycle traders, Gann-based analysts, or anyone who respects time symmetry in the markets.
Fully customizable & works across all timeframes.
This tool was created by AngelArt as part of a larger astro-market model using lunar timing and planetary retrogrades for cycle-based market analysis.
Astro: Moon SizeThe Astro: Moon Size indicator, built using AstroLib , calculates the distance and visualizes the apparent size of the Moon based on astronomical positioning. This script is tailored for the 1D timeframe and provides insights into lunar perigees (closest approach) and apogees (farthest distance), making it useful for astrologically-informed trading strategies.
New Astro Indicators Feature:
By setting the Julian Date to X number of days in the future, and offsetting the plot by X number of bars accordingly, it is now possible to visualize future projections of TradingView indicators that reference the AstroLib . This feature has been long requested and is far overdue, so thank you to everyone who pushed for this feature release. Enjoy, time travelers from the future!!
Key Features:
Moon Size Calculation: Uses Julian Date (J2000) conversion and AstroLib functions to determine the Moon's apparent distance.
Future Projection: Displays the Moon's distance from 28 up to 500 days ahead, with color gradients indicating proximity/size.
Pivot Identification: Marks local maxima (apogees) and minima (perigees) with labeled date stamps for easy reference.
Dynamic Labeling: Adapts label positioning and size based on the Moon's current trend and relative size.
Usage Notes:
⚠️ Timeframe Restriction: For now, the script only functions on the 1D timeframe and will prompt an error otherwise.
⚠️ Asset Restriction: This script is meant to be loaded on charts for assets that trade 24/7, like BTCUSD historical index.
Astro: Celestial Body Channel LinesThis is fork of the previous Astro: Planetary Channel Lines indicator that now includes over a dozen different celestial bodies, made possible after the most recent update of the AstroLib library.
Celestial Body Channel Lines is an approach to financial astrology that involves using the positions of the celestial bodies to predict trends and patterns in the stock market. The idea behind celestial body lines is that the positions of the bodies in the sky at the time of a market event can significantly influence that event.
The celestial body lines approach involves mapping the bodies' positions onto a stock market graph, with each body's position representing a specific line. These lines are thought to indicate areas of support and resistance, as well as potential turning points in the market.
This indicator includes geocentric/heliocentric celestial body lines on the chart for up to two bodies, price scaling & vertical offset, mirror/inversion switch, retrograde highlighting, and aspect recognition with customizable precision.
Astro: Celestial Body LongitudesThis is fork of the previous Astro: Planetary Longitudes indicator that now includes over a dozen different celestial bodies, made possible after the most recent update of the AstroLib library .
Celestial longitude is a measurement of the position of a celestial body in its orbit around the Sun, expressed in degrees of arc along the plane of the body's orbit. It is one of the fundamental coordinates used in astronomy to describe the position of a planet or other celestial object.
The concept of longitude is important in astrology, where it is used to determine the position of the planets in the zodiac. In this context, the longitude is measured along the ecliptic, which is the apparent path of the Sun on the celestial sphere. Astrologers use the position of the planets in the zodiac to make predictions and interpretations about personality traits, life events, earthquakes, market events, and other aspects of human experience.
This indicator includes geocentric/heliocentric longitude lines with retrograde identification, Vedic Nakshatras, and astrological zodiac & aspects for each of the celestial bodies. Hover over labels for additional information.
Astro: Planetary Channel LinesPlanetary Channel Lines is an approach to financial astrology that involves using the positions of the planets to predict trends and patterns in the stock market. The idea behind planetary lines is that the positions of the planets in the sky at the time of a market event can significantly influence that event.
The planetary lines approach involves mapping the planets' positions onto a stock market graph, with each planet's position representing a specific line. These lines are thought to indicate areas of support and resistance, as well as potential turning points in the market.
This indicator includes geocentric/heliocentric planetary lines on the chart for up to two planets, price scaling & vertical offset, retrograde highlighting, and aspect recognition with customizable precision.
Astro: Celestial CoordinatesCelestial coordinates are a system of measurements used in astronomy and astrology to describe the positions of celestial objects such as stars, planets, and constellations. There are several different celestial coordinates, including right ascension (RA), longitude, latitude, declination, and altitude. Each coordinate has its own astronomical or astrological significance, as outlined below:
Right ascension (RA) is a coordinate used to describe the position of an object in the sky along the celestial equator. It is measured in hours, minutes, and seconds and is analogous to longitude on Earth. RA is significant in both astronomy and astrology because it allows astronomers and astrologers to accurately locate celestial objects in the sky.
Longitude is a coordinate used to describe the position of a planet or other object in its orbit around the Sun. It is measured in degrees and is significant in astronomy because it allows astronomers to accurately predict the positions of planets and other objects in the solar system.
Latitude is a coordinate used to describe the position of an object in the sky relative to the celestial equator. It is measured in degrees and is significant in both astronomy and astrology because it helps astronomers and astrologers to determine the positions of celestial objects in the sky.
Declination is a coordinate used to describe the position of an object in the sky relative to the celestial equator, similar to latitude but measured in degrees north or south of the celestial equator. It is significant in astronomy because it allows astronomers to accurately locate objects in the sky.
Altitude is a coordinate used to describe the height of an object above the horizon. It is measured in degrees and is significant in both astronomy and astrology because it allows astronomers and astrologers to determine when objects will be visible in the sky and at what angle.
In astrology, celestial coordinates are used to create maps of the positions of celestial objects. This indicator plots the corresponding celestial coordinate
values for each planet, moon, or sun and labels key turning (pivot) points with a date (& optional time). Hover over labels for additional information.
Astro: Planetary SpeedPlanetary speed refers to the rate at which a planet moves along its orbit around the Sun. The speed of a planet can vary depending on its distance from the Sun, and is generally fastest at the point in its orbit where it is closest to the Sun (perihelion) and slowest at the point where it is farthest from the Sun (aphelion).
The significance of planetary speeds lies in their astrological interpretation. In astrology, the speed of a planet is thought to influence its energy and influence earthly affairs. Fast-moving planets, such as Mercury and Venus, are believed to have a more immediate and fleeting influence, while slower-moving planets, such as Jupiter and Saturn, are thought to have a more long-lasting and significant impact.
Astrologers use the speed of the planets, along with their positions, aspects, and other factors, to interpret their influence. By understanding the energy and symbolism associated with each planet, astrologers can provide insight and guidance to individuals seeking a greater understanding.
Astro: Solar SystemA bird's eye view model of the solar system is a simplified representation of our planetary system as seen from above. It can be thought of as a two-dimensional map of the solar system, in which the planets are shown in their approximate heliocentric longitudinal positions relative to the Sun and each other.
In this model, the Sun is shown as a large, central emoji, with the planets arranged in orbits around it. The inner planets - Mercury, Venus, Earth, and Mars - are located close to the Sun and inside the asteroid belt, while the outer planets - Jupiter, Saturn, Uranus, Neptune, and Pluto- are located farther out.
In a bird's eye view model, some of the details of the solar system are necessarily left out or simplified. For example, the distances between the planets are not to scale, and the orbits are shown as perfect circles rather than the elliptical shapes they actually are. Nonetheless, this model can provide a useful visual real-time representation of the relative heliocentric longitudinal positions (aspects) of the planets in our solar system.
🏅 Shoutout to @LuxAlgo for the circle code!
Astro: Planetary Aspect TableIn astrology, planetary aspects refer to the angles formed between two or more planets in a horoscope or birth chart. These angles are created by the positions of the planets in the sky and are thought to represent a particular energy or influence that can impact events on Earth.
The most common planetary aspects are the conjunction (when two planets are in the same position in the zodiac), the opposition (when two planets are direct across from each other in the zodiac), the trine (when two planets are 120 degrees apart in the zodiac), and the square (when two planets are 90 degrees apart in the zodiac).
This chart overlay displays a real-time table of current interplanetary aspects for all AstroLib celestial body combinations.
Astro: Planetary Aspect DatesIn astrology, planetary aspects refer to the angles formed between two or more planets in a horoscope or birth chart. These angles are created by the positions of the planets in the sky and are thought to represent a particular energy or influence that can impact events on Earth.
The most common planetary aspects are the conjunction (when two planets are in the same position in the zodiac), the opposition (when two planets are direct across from each other in the zodiac), the trine (when two planets are 120 degrees apart in the zodiac), and the square (when two planets are 90 degrees apart in the zodiac).
This chart overlay is a simple companion indicator that highlights aspect dates for the following oscillator:
Astro: Planetary AspectsIn astrology, planetary aspects refer to the angles formed between two or more planets in a horoscope or birth chart. These angles are created by the positions of the planets in the sky and are thought to represent a particular energy or influence that can impact events on Earth.
The most common planetary aspects are the conjunction (when two planets are in the same position in the zodiac), the opposition (when two planets are direct across from each other in the zodiac), the trine (when two planets are 120 degrees apart in the zodiac), and the square (when two planets are 90 degrees apart in the zodiac).
This oscillator plots the current geocentric/heliocentric aspect for up to two planets and features a customizable precision of degree (up to +/- 15 degrees) for each aspect.
Astro: Planetary LongitudesPlanetary longitude is a measurement of the position of a planet in its orbit around the Sun, expressed in degrees of arc along the plane of the planet's orbit. It is one of the fundamental coordinates used in astronomy to describe the position of a planet or other celestial object.
The concept of planetary longitude is important in astrology, where it is used to determine the position of the planets in the zodiac. In this context, the longitude is measured along the ecliptic, which is the apparent path of the Sun on the celestial sphere. Astrologers use the position of the planets in the zodiac to make predictions and interpretations about personality traits, life events, earthquakes, market events, and other aspects of human experience.
This indicator includes geocentric/heliocentric longitude lines with retrograde identification, Vedic Nakshatras, and astrological zodiac & aspects for each of the 9 planets plus the Sun & Moon. Hover over labels for additional information.
🏅Shoutout to @AdzAdama and @Virinchi for all the help with this indicator






















