2026-02-04 20:58:05 -08:00
# SOLAR: Solar Cycle Indicator
2026-03-11 20:21:52 -07:00
> *Solar cycles encode the Sun's rhythmic activity into a tradeable signal, bridging astrophysics and price action.*
2026-02-27 07:48:12 -08:00
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Cycle |
| **Inputs** | Source (close) |
| **Parameters** | None |
| **Outputs** | Single series (SOLAR) |
| **Output range** | Varies (see docs) |
| **Warmup** | `0` bars |
2026-03-11 15:35:33 -07:00
| **PineScript** | [solar.pine ](solar.pine ) |
2026-02-27 07:48:12 -08:00
- SOLAR models Earth's seasonal position relative to the Sun using astronomical ephemeris calculations.
- No configurable parameters; computation is stateless per bar.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
2026-02-20 21:40:32 -08:00
SOLAR models Earth's seasonal position relative to the Sun using astronomical ephemeris calculations. Output oscillates continuously from $-1.0$ (Winter Solstice) through $0.0$ (Equinoxes) to $+1.0$ (Summer Solstice), providing a smooth, mathematically precise seasonal phase for econometric modeling. Like LUNAR, the indicator is purely time-based, requires no price data, and has zero warmup since the calculation is deterministic from any timestamp.
2026-02-04 20:58:05 -08:00
## Historical Context
2026-02-20 21:40:32 -08:00
Seasonal adjustments are fundamental to econometric analysis. Agricultural commodities, retail sales, energy consumption, and tourism all exhibit strong annual patterns. Traditional approaches use monthly dummy variables or calendar-based lookup tables, creating discontinuities at month boundaries. Astronomical seasonality offers a continuous, smooth alternative: the Sun's ecliptic longitude provides an exact phase position within the annual cycle at any time resolution. The implementation derives from Jean Meeus' *Astronomical Algorithms* (1998), computing the Sun's geometric mean longitude, mean anomaly, and equation of center with sufficient precision ($\pm 0.01°$) for financial applications. Unlike lunar cycles, the tropical year's length varies by only seconds over centuries, making solar seasonality highly predictable.
2026-02-04 20:58:05 -08:00
## Architecture & Physics
2026-02-20 21:40:32 -08:00
### 1. Julian Date Conversion
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
$$JD = \frac{UnixMs}{86400000} + 2440587.5$$
2026-02-04 20:58:05 -08:00
2026-02-05 19:42:49 -08:00
$$T = \frac{JD - 2451545.0}{36525.0}$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
where $T$ is Julian centuries from the J2000.0 epoch.
### 2. Geometric Mean Longitude
2026-02-04 20:58:05 -08:00
2026-02-05 19:42:49 -08:00
The Sun's mean position in its apparent orbit:
2026-02-04 20:58:05 -08:00
2026-02-05 19:42:49 -08:00
$$L_0 = 280.46646 + 36000.76983T + 0.0003032T^2$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### 3. Mean Anomaly
2026-02-04 20:58:05 -08:00
2026-02-05 19:42:49 -08:00
Angular distance from perihelion:
2026-02-04 20:58:05 -08:00
2026-02-05 19:42:49 -08:00
$$M = 357.52911 + 35999.05029T - 0.0001537T^2$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### 4. Equation of Center
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
Correction for orbital eccentricity ($e \approx 0.0167$):
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
$$C = (1.914602 - 0.004817T - 0.000014T^2) \sin M + (0.019993 - 0.000101T) \sin 2M + 0.000289 \sin 3M$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### 5. True Ecliptic Longitude
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
$$\lambda_{Sun} = L_0 + C$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### 6. Seasonal Index
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
$$Solar = \sin(\lambda_{Sun})$$
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
This maps: Vernal Equinox ($\lambda = 0°$) $\to 0$, Summer Solstice ($\lambda = 90°$) $\to +1$, Autumnal Equinox ($\lambda = 180°$) $\to 0$, Winter Solstice ($\lambda = 270°$) $\to -1$.
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### 7. Complexity
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
$O(1)$ per timestamp. No state required. Zero warmup. The tropical year is approximately 365.242 days.
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
## Mathematical Foundation
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### Parameters
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
| Parameter | Description | Default | Constraint |
|-----------|-------------|---------|------------|
| (none) | No user-configurable parameters | | |
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
The calculation is entirely determined by the input timestamp.
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### Seasonal Correspondence (Northern Hemisphere)
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
| Date (approx.) | $\lambda_{Sun}$ | Solar Value | Season |
|-----------------|-----------------|-------------|--------|
| March 20 | $0°$ | $0.0$ | Vernal Equinox |
| June 21 | $90°$ | $+1.0$ | Summer Solstice |
| September 22 | $180°$ | $0.0$ | Autumnal Equinox |
| December 21 | $270°$ | $-1.0$ | Winter Solstice |
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
### Output Interpretation
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
| Condition | Meaning |
|-----------|---------|
| $Solar \approx +1$ | Peak summer (Northern Hemisphere) |
| $Solar \approx -1$ | Peak winter (Northern Hemisphere) |
| $Solar = 0$ (rising) | Spring equinox crossing |
| $Solar = 0$ (falling) | Autumn equinox crossing |
| Southern Hemisphere | Negate the output |
2026-02-04 20:58:05 -08:00
2026-02-21 20:45:38 -08:00
## Performance Profile
### Operation Count (Streaming Mode)
| Operation | Count per bar | Notes |
|-----------|--------------|-------|
| Julian date conversion | ~4 | 1 DIV + 1 ADD + 1 SUB + 1 DIV |
| Horner polynomial (L0) | ~5 | 2 FMA + 1 mod |
| Horner polynomial (M) | ~5 | 2 FMA + 1 mod |
| SIN evaluations (equation of center) | ~24 | 3 `Math.Sin` calls (~8 cycles each) |
| Equation of center arithmetic | ~8 | 3 FMA chains + 2 ADD |
| True longitude addition | ~1 | 1 ADD |
| Final SIN (seasonal index) | ~10 | 1 degree-to-radian MUL + 1 `Math.Sin` |
| **Total** | ** ~57** | **O(1) pure arithmetic; simpler than LUNAR** |
### Batch Mode (SIMD Analysis)
| Aspect | Assessment |
|--------|------------|
| SIMD vectorizable | Yes: fully stateless; each timestamp independent; `Vector<double>` applicable |
| Bottleneck | 4 transcendental calls (3 SIN for equation of center + 1 final SIN); ~32 cycles |
| Parallelism | Full: no inter-bar dependencies; ideal for `Vector<double>` batch processing |
| Memory | O(0): zero state; pure function of timestamp |
| Throughput | Fastest cycle indicator; ~2× faster than LUNAR (fewer perturbation terms) |
2026-02-20 21:40:32 -08:00
## Resources
2026-02-04 20:58:05 -08:00
2026-02-20 21:40:32 -08:00
- **Meeus, J.** *Astronomical Algorithms* . 2nd ed., Willmann-Bell, 1998.
2026-03-13 13:46:52 -07:00
- **USNO** *Astronomical Almanac* . U.S. Government Publishing Office (annual reference for solstice/equinox verification).