OPEN-SOURCE SCRIPT
3D Globe - World Stock Markets

A real-time 3D rotating globe visualization showing 19 major stock exchanges worldwide with their current trading status.
█ OVERVIEW
This indicator displays an interactive 3D Earth globe that rotates in sync with the sun (sun-synchronous rotation), providing an intuitive view of which markets are currently in daylight/trading hours. Each stock exchange is plotted at its geographic location with color-coded status indicators.
█ FEATURES
- 3D Globe Rendering
- Spherical projection with proper visibility culling (hidden side not drawn)
- 27 country/region polygons derived from Natural Earth 110m data
- Optional latitude/longitude grid (meridians every 20°, parallels every 20°)
- Sun-synchronous auto-rotation: the globe rotates 15° per hour to follow real-world daylight
- 19 Stock Exchanges Tracked
NYSE, NASDAQ, TSX (Toronto), BMV (Mexico), B3 (São Paulo), LSE (London), EURONEXT (Paris), XETRA (Frankfurt), SIX (Zurich), MOEX (Moscow), TADAWUL (Riyadh), JSE (Johannesburg), NSE (Mumbai), SSE (Shanghai), HKEX (Hong Kong), TSE (Tokyo), KRX (Seoul), SGX (Singapore), ASX (Sydney)
- Real-Time Market Table (10 columns)
- Status indicator (● open / ○ closed)
- Exchange name and country with flag
- Local time with seconds (HH:MM:SS)
- Opening time
- Time to open (for closed markets)
- Time since open (for open markets)
- Time to close (for open markets)
- Index name (S&P500, FTSE, DAX, CAC40, N225, HSI, etc.)
- Daily % change with color coding
█ HOW IT WORKS
The globe uses standard 3D mathematics:
1. Geographic coordinates (lat/lon) are converted to 3D Cartesian points on a unit sphere
2. Rotation matrices are applied for X-axis tilt and Y-axis rotation (sun position)
3. Points are projected onto 2D screen space
4. Visibility culling hides points on the far side of the globe (z < 0)
Performance optimization: The globe redraws only when the minute changes, while the market table updates every tick for accurate second-by-second timing.
█ SETTINGS
Globe Group:
- Globe Size: Adjustable radius (15-60)
- Show Grid: Toggle latitude/longitude lines
- Fill Continents: Toggle solid land fill vs outline only
Style Group:
- Background, Ocean, Land, Land Border, Grid colors
- Open/Closed market indicator colors
- Globe border color
Table Group:
- Position: Left or Right side
- Show/Hide market table
█ DATA SOURCES
- Geographic data: Simplified polygons derived from Natural Earth (public domain)
- Market hours: Standard trading sessions (does not account for holidays)
- Index data: Real-time from TradingView (TVC, MOEX, TADAWUL, NSE, SSE, ASX providers)
█ LIMITATIONS
- Market hours are based on regular sessions only (no pre/post market, no holiday calendar)
- UTC offsets are fixed (no automatic DST adjustment)
- Some index symbols may not be available in all regions
█ USE CASES
- Quick visual overview of global market activity
- Identifying trading opportunities across time zones
- Understanding market session overlaps
- Educational tool for learning about world markets
Open-source under Mozilla Public License 2.0.
█ OVERVIEW
This indicator displays an interactive 3D Earth globe that rotates in sync with the sun (sun-synchronous rotation), providing an intuitive view of which markets are currently in daylight/trading hours. Each stock exchange is plotted at its geographic location with color-coded status indicators.
█ FEATURES
- 3D Globe Rendering
- Spherical projection with proper visibility culling (hidden side not drawn)
- 27 country/region polygons derived from Natural Earth 110m data
- Optional latitude/longitude grid (meridians every 20°, parallels every 20°)
- Sun-synchronous auto-rotation: the globe rotates 15° per hour to follow real-world daylight
- 19 Stock Exchanges Tracked
NYSE, NASDAQ, TSX (Toronto), BMV (Mexico), B3 (São Paulo), LSE (London), EURONEXT (Paris), XETRA (Frankfurt), SIX (Zurich), MOEX (Moscow), TADAWUL (Riyadh), JSE (Johannesburg), NSE (Mumbai), SSE (Shanghai), HKEX (Hong Kong), TSE (Tokyo), KRX (Seoul), SGX (Singapore), ASX (Sydney)
- Real-Time Market Table (10 columns)
- Status indicator (● open / ○ closed)
- Exchange name and country with flag
- Local time with seconds (HH:MM:SS)
- Opening time
- Time to open (for closed markets)
- Time since open (for open markets)
- Time to close (for open markets)
- Index name (S&P500, FTSE, DAX, CAC40, N225, HSI, etc.)
- Daily % change with color coding
█ HOW IT WORKS
The globe uses standard 3D mathematics:
1. Geographic coordinates (lat/lon) are converted to 3D Cartesian points on a unit sphere
2. Rotation matrices are applied for X-axis tilt and Y-axis rotation (sun position)
3. Points are projected onto 2D screen space
4. Visibility culling hides points on the far side of the globe (z < 0)
Performance optimization: The globe redraws only when the minute changes, while the market table updates every tick for accurate second-by-second timing.
█ SETTINGS
Globe Group:
- Globe Size: Adjustable radius (15-60)
- Show Grid: Toggle latitude/longitude lines
- Fill Continents: Toggle solid land fill vs outline only
Style Group:
- Background, Ocean, Land, Land Border, Grid colors
- Open/Closed market indicator colors
- Globe border color
Table Group:
- Position: Left or Right side
- Show/Hide market table
█ DATA SOURCES
- Geographic data: Simplified polygons derived from Natural Earth (public domain)
- Market hours: Standard trading sessions (does not account for holidays)
- Index data: Real-time from TradingView (TVC, MOEX, TADAWUL, NSE, SSE, ASX providers)
█ LIMITATIONS
- Market hours are based on regular sessions only (no pre/post market, no holiday calendar)
- UTC offsets are fixed (no automatic DST adjustment)
- Some index symbols may not be available in all regions
█ USE CASES
- Quick visual overview of global market activity
- Identifying trading opportunities across time zones
- Understanding market session overlaps
- Educational tool for learning about world markets
Open-source under Mozilla Public License 2.0.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.