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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。