OPEN-SOURCE SCRIPT
تم تحديثه

天干地支标注(当前视窗范围 + 居中标签)

212
🇨🇳 中文说明

天干地支标注(自动匹配周期)

本指标会根据图表的时间周期(年、月、日、小时、分钟)自动计算并在每根 K 线上方显示对应的天干地支。
• 自动识别图表周期(年/月/日/时/分)
• 仅显示当前视窗内的柱子,性能高、不卡顿
• 可自定义每隔 N 根显示一次(默认每根)
• 支持居中矩形标签(label.style_label_center),清晰易读
• 无需区分暗黑/亮色主题,自动兼容所有图表样式

可作为金融时间序列与中国传统历法(干支纪时)结合的参考工具,
在时间周期研究、风水、气运周期、江恩时间分析等领域有辅助价值。



🇬🇧 English Description (for international visibility)

Heavenly Stems & Earthly Branches Marker (Auto-Adaptive Version)

This indicator automatically calculates and displays the corresponding Chinese Heavenly Stems and Earthly Branches (Ganzhi) for each candlestick, based on the chart’s timeframe (Year, Month, Day, Hour, or Minute).
• Auto-detects chart timeframe
• Draws only within the current visible window (optimized performance)
• Adjustable display interval (e.g., show every N bars)
• Uses centered label style for clarity
• Compatible with both dark and light themes

Useful for combining Chinese calendar cycles with financial time analysis, time-cycle studies, or Gann-style timing models.
ملاحظات الأخبار
🇨🇳 中文说明

天干地支标注(GanZhi Marker)
本脚本在K线图上为每根蜡烛添加对应的天干地支信息,支持自动识别周期(年柱、月柱、日柱、时柱),可直观查看时间对应的干支变化。

🔹 主要特性:
• 自动计算 年、月、日、时 四柱干支。
• 支持公历时间计算,精确至北京时间(UTC+8)。
• 通过节气算法划分月份,符合农历逻辑。
• 可选择显示 tooltip,查看完整四柱与公历时间。
• 自定义显示间隔与可见范围,防止图表过载。
• 兼容 TradingView 亮/暗主题,标签样式美观。

🔹 使用提示:
• 推荐在分钟、小时、日线等周期下使用;
• 建议 visibleBars = 500 保证流畅显示;
• Tooltip 模式可快速查看对应柱的完整干支排盘信息。

📅 应用场景:
适合风水、奇门、占星、八字等研究者,或需要在图表中观察时间干支变化的交易者。


🇺🇸 English Description

Heavenly Stems & Earthly Branches Marker (GanZhi Label Indicator)
This indicator displays the Chinese Sexagenary Cycle (GanZhi) — the Heavenly Stems and Earthly Branches — directly on each candlestick in TradingView. It automatically identifies and annotates the corresponding Year, Month, Day, and Hour Pillars, providing a clear temporal reference on the chart.

🔹 Key Features:
• Calculates the Four Pillars (Year, Month, Day, Hour) of GanZhi automatically.
• Works in Beijing Time (UTC+8) for accurate pillar calculation.
• Month pillar determined by solar terms (jieqi), following lunar tradition.
• Optional tooltip shows full four-pillar details and Gregorian time.
• Adjustable display interval and maximum visible bar range.
• Visually clean and theme-compatible (light/dark mode friendly).

🔹 Usage Notes:
• Recommended for use on minute, hourly, or daily timeframes.
• Keep visibleBars ≤ 500 to ensure smooth rendering.
• Enable tooltip for quick reference to the complete pillar information.

📅 Applications:
Ideal for astrology, feng shui, Bazi (Four Pillars of Destiny) analysis, or for traders who wish to align market cycles with traditional Chinese time systems.

إخلاء المسؤولية

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.