PROTECTED SOURCE SCRIPT

[PS] Planetary Movements & Nakshatras - Adv Astrological Trading

29
🌟 Planetary Movements & Nakshatras - Advanced Astrological Trading Indicator
📊 Overview
Planetary Movements & Nakshatras is a comprehensive Pine Script indicator that bridges ancient Vedic astrology with modern technical analysis. This powerful tool overlays planetary positions, transitions, alignments, and nakshatras (lunar mansions) directly on your price charts, providing unique insights into potential market movements based on celestial patterns.
🎯 Key Features
1. Real-Time Planetary Tracking

Displays current positions of 7 major celestial bodies: Sun ☉, Moon ☽, Mercury ☿, Venus ♀, Mars ♂, Jupiter ♃, and Saturn ♄
Shows each planet's current zodiac sign and nakshatra
Optional degree display for precise astronomical positioning
Color-coded labels for easy identification

2. Industry-Specific Intelligence
Choose from 15 industry classifications with customized planetary and nakshatra associations:

Technology - Mercury, Rahu, Uranus (Innovation & Communication)
Finance/Banking - Jupiter, Mercury, Venus (Wealth & Trade)
Healthcare/Pharma - Sun, Moon, Jupiter (Vitality & Healing)
Energy/Oil - Sun, Mars (Power & Energy)
Agriculture - Moon, Venus, Jupiter (Growth & Fertility)
Real Estate - Saturn, Mars, Venus (Property & Construction)
Media/Entertainment - Venus, Mercury, Moon (Arts & Creativity)
Transportation - Mars, Mercury, Moon (Movement & Travel)
Metals/Mining - Saturn, Mars, Sun (Minerals & Iron)
FMCG/Retail - Venus, Mercury, Moon (Commerce & Consumer Goods)
Telecom - Mercury, Rahu (Communication & Networks)
Automobile - Mars, Saturn, Mercury (Machinery & Engineering)
Defense - Mars, Sun, Saturn (War & Discipline)
Education - Jupiter, Mercury, Moon (Knowledge & Learning)
General - All planets (Universal application)

Primary planets for each industry are marked with ★ and highlighted with vibrant colors, while secondary planets appear muted.
3. 27 Nakshatras (Lunar Mansions)
Complete coverage of all 27 Vedic nakshatras from Ashwini to Revati:

Each nakshatra spans 13.33° of the zodiac
Industry-specific favorable nakshatras marked with ✓
Visual nakshatra boundaries with dotted lines
Configurable display: Lines, Labels, Both, or None
Enhanced visualization for auspicious nakshatras

4. Planetary Transitions & Sign Changes
Track when planets change zodiac signs (every 30°):

Triangle markers indicate sign transitions
Historical price impact displayed with each transition
Shows average upward ↑% and downward ↓% swing following the event
Significant transitions highlighted at chart bottom
Regular transitions appear at chart top

5. Planetary Alignments & Aspects
Detects major astronomical events:

Conjunctions - Planets in the same position (customizable orb: 1-15°)
Oppositions - Planets 180° apart (customizable orb: 1-15°)
Sun-Moon Conjunctions (New Moon) - Powerful market turning points
Sun-Moon Oppositions (Full Moon) - High volatility periods
Jupiter-Saturn Conjunctions - Major cycle indicators (every 20 years)
Background highlighting for major alignments

6. Advanced Pattern Detection System
Machine learning-inspired historical analysis:

Automatic Pattern Recognition - Identifies recurring planetary configurations
Swing Analysis - Calculates price movements following each event
Configurable Parameters:

Minimum Swing Threshold (0.5% - 50%)
Lookforward Period (5-180 days)
Minimum Occurrences (1-10 instances)


Statistical Tracking:

Count of pattern occurrences
Average upward swing percentage
Average downward swing percentage
Maximum upward swing
Maximum downward swing


Industry Relevance Filtering - Focus only on patterns relevant to your sector

7. Three Interactive Information Tables
📋 Industry Planet Guide Table (Configurable Position)

Shows primary planets to watch for your selected industry
Lists favorable nakshatras for optimal timing
Legend explaining symbols (★ = Primary, ✓ = Favorable)
Compact format with color-coded information

📊 Pattern Statistics Table (Configurable Position)

Historical performance data for all detected patterns
Sortable by significance
Columns: Pattern Name, Count, Avg↑%, Avg↓%, Max↑%, Max↓%, Relevance
Color-coded thresholds (green for bullish, red for bearish)
Industry relevance marked with ★
Shows up to 15 most significant patterns

🔮 Future Events Table (Configurable Position)

Projects planetary events up to 365 days into the future
Lists upcoming transitions, conjunctions, and oppositions
Shows historical average price impacts for each future event
Date, Event type, Sign/Nakshatra, Expected swing percentages
Significant events marked with ★
Displays up to 20 upcoming events

Table Positioning: Each table can be placed in any of 9 positions:

Top: Left, Center, Right
Middle: Left, Center, Right
Bottom: Left, Center, Right

8. Visual Enhancements

Nakshatra Boundary Lines - Dotted vertical lines every 27 bars
Color-Coded Events - Orange (Sun), Silver (Moon), Yellow (Mercury), Green (Venus), Red (Mars), Purple (Jupiter), Blue (Saturn)
Significance Highlighting - Bright colors for high-impact events, muted for regular events
Background Shading - Subtle yellow for Sun-Moon conjunctions, purple for Jupiter-Saturn conjunctions
Responsive Labels - Adjustable size (tiny, small, normal, large)

9. Astronomical Calculations

Julian Day Number conversion for precise date handling
Keplerian Orbital Elements for planetary position calculation
J2000 Epoch (January 1, 2000) as reference point
Accurate for historical, current, and future dates
Accounts for mean longitude and orbital mechanics

🎛️ Comprehensive Settings
Industry Settings

15 industry types with pre-configured planetary associations

Planets Group

Toggle planetary positions display
Toggle transition markers
Toggle alignment indicators

Planet Selection

Individual on/off switches for all 7 planets
Mix and match based on your trading strategy

Pattern Detection

Enable/disable pattern recognition
Minimum swing threshold (%)
Days to measure swing impact
Minimum pattern occurrences for validity
Highlight significant events
Filter by industry-relevant planets

Alignments

Conjunction orb (1-15°)
Opposition orb (1-15°)
Customizable sensitivity

Display Options

Label size selection
Show/hide degree measurements
Toggle all three information tables
Nakshatra display modes

Table Settings

Show/hide Future Events Table
Show/hide Pattern Statistics Table
Show/hide Industry Guide Table
Configure position for each table (9 positions)
Adjust future projection days (30-365)

Nakshatras

Display modes: Lines, Labels, Both, or None
Automatic favorable nakshatra highlighting

💡 Use Cases
Timing Market Entries & Exits

Identify high-probability periods using planetary alignments
Watch for favorable nakshatra transits in your industry
Track historical success rates of specific planetary configurations

Risk Management

Be aware of volatile periods (Full Moons, major transitions)
Reduce position sizes during unfavorable planetary periods
Increase exposure during auspicious nakshatra alignments

Industry-Specific Analysis

Technology stocks may respond to Mercury movements
Banking stocks may correlate with Jupiter-Venus alignments
Energy stocks may track Sun-Mars aspects

Long-Term Cycle Analysis

Jupiter-Saturn conjunctions mark major market cycles (20-year cycles)
Saturn transitions indicate sector rotation (2.5-year cycles)
Jupiter transitions show expansion/contraction phases (1-year cycles)

Intraday & Swing Trading

Moon transitions every 2.5 days for short-term timing
Mercury retrogrades for communication/tech sector volatility
Venus transitions for consumer goods and luxury items

Pattern Backtesting

Quantify historical price impacts of specific events
Build confidence in planetary timing strategies
Compare multiple patterns for optimal selection

📈 Performance & Optimization

Efficient Calculations - Optimized algorithms for minimal lag
Smart Pattern Storage - Tracks only significant patterns
Configurable Display Limits - Control label and line counts
Future Projection - Pre-calculates events without real-time overhead
Industry Filtering - Reduces noise by focusing on relevant patterns

🔧 Technical Specifications

Pine Script Version: 6
Chart Type: Overlay (true)
Max Labels: 500
Max Lines: 500
Max Boxes: 500
Calculation Method: Simplified Keplerian orbital mechanics
Date Range: Works for past, present, and future dates
Zodiac System: Tropical (Western) zodiac with Vedic nakshatras

🌙 Nakshatra Reference
All 27 nakshatras are supported with industry-specific favorable classifications:

Ashwini - Swift action, healing, pioneering (Tech, Auto, Transport)
Bharani - Transformation, restraint (Defense, Entertainment)
Krittika - Purification, cutting through (Energy, Real Estate, Metals)
Rohini - Growth, beauty, fertility (Finance, Agriculture, FMCG)
Mrigashira - Seeking, curiosity (Agriculture, Auto)
Ardra - Storm, transformation, breakthroughs (Tech, Telecom)
Punarvasu - Renewal, expansion (Agriculture, Transport, Telecom, Education)
Pushya - Nourishment, prosperity (Finance, Healthcare, Agriculture, Education)
Ashlesha - Control, mysticism (Healthcare)
Magha - Power, authority, leadership (Energy, Metals, Defense)
... and 17 more nakshatras with specific industry associations

🎨 Color Scheme

Sun ☉ - Orange (vitality, authority)
Moon ☽ - Silver (emotions, public)
Mercury ☿ - Yellow (communication, intellect)
Venus ♀ - Green (beauty, wealth, harmony)
Mars ♂ - Red (action, energy, conflict)
Jupiter ♃ - Purple (expansion, wisdom, fortune)
Saturn ♄ - Blue (restriction, discipline, structure)

📚 Trading Strategy Ideas
The Industry-Specific Strategy

Select your stock's industry classification
Focus only on primary planet transitions (marked with ★)
Wait for favorable nakshatra alignments (marked with ✓)
Check Pattern Statistics Table for historical success rate
Enter on confluence of favorable conditions

The Alignment Trading Strategy

Monitor Sun-Moon conjunctions (New Moons) for trend reversals
Track Sun-Moon oppositions (Full Moons) for volatility spikes
Use conjunction orb settings to fine-tune sensitivity
Compare with technical support/resistance levels

The Pattern Recognition Strategy

Enable Pattern Detection with your preferred parameters
Set minimum swing threshold based on your risk tolerance
Focus on patterns with high occurrence counts (5+)
Use Future Events Table to plan entries in advance
Backtest patterns in Pattern Statistics Table

The Nakshatra Timing Strategy

Identify favorable nakshatras for your industry
Wait for Moon to transit through favorable nakshatras
Combine with planetary transitions for stronger signals
Use nakshatra boundary lines for visual confirmation

⚠️ Disclaimer
This indicator is for educational and research purposes only. Planetary positions and astrological calculations should not be the sole basis for trading decisions. Always combine with fundamental analysis, technical analysis, and proper risk management. Past performance of planetary patterns does not guarantee future results. Trading involves substantial risk of loss.
🔄 Updates & Support
This indicator combines ancient wisdom with modern data analysis. While planetary positions are calculated using established astronomical formulas, the correlation between celestial events and market movements is a subject of ongoing research and debate. Use this tool as one component of a comprehensive trading strategy.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.