OPEN-SOURCE SCRIPT
Diupdate

Date Display with Bar Counter and EMA

125
===== ENGLISH DESCRIPTION =====

OVERVIEW:
This is a multi-function indicator that combines three useful tools in one script:
1. Date Display - Shows current date and symbol information in a customizable table
2. Bar Counter - Displays sequential bar numbers at specified intervals
3. EMA (Exponential Moving Average) - Plots an EMA line with customizable settings

FEATURES:

1. DATE DISPLAY:
- Shows date in full format (e.g., "Mon ∙ January 1, 2023") or short format (e.g., "Mon ∙ 01.01.23")
- Option to show/hide day of week
- Option to show/hide symbol and timeframe information
- Customizable table position (top/middle/bottom, left/center/right)
- Automatic color adjustment based on chart background

2. BAR COUNTER:
- Displays sequential bar numbers below price bars
- Customizable display frequency (every X bars)
- Special handling for Hong Kong futures (resets at market open)
- Different reset logic based on timeframe (daily, weekly, monthly)
- Customizable text size and color

3. EMA INDICATOR:
- Customizable period length (default: 20)
- Option to use different timeframe for calculation
- Option to wait for timeframe close for more stable signals
- Customizable line color

USAGE INSTRUCTIONS:
- After adding the indicator to your chart, customize settings in the "Format" panel
- The Date Display table will appear at your chosen position on the chart
- Bar numbers will appear below price bars at your specified frequency
- The EMA line will be plotted on the chart with your chosen settings
- Colors automatically adjust to light/dark chart themes

===== 中文说明 =====

概述:
这是一个多功能指标,将三个实用工具合并为一个脚本:
1. 日期显示 - 在可自定义的表格中显示当前日期和交易品种信息
2. K线计数器 - 按指定间隔显示K线序号
3. EMA指数移动平均线 - 绘制可自定义设置的EMA线

功能特点:

1. 日期显示:
- 支持完整格式(如"Mon ∙ January 1, 2023")或简短格式(如"Mon ∙ 01.01.23")
- 可选择显示/隐藏星期几
- 可选择显示/隐藏交易品种和时间周期信息
- 可自定义表格位置(顶部/中部/底部,左侧/中间/右侧)
- 根据图表背景自动调整颜色

2. K线计数器:
- 在价格K线下方显示序号
- 可自定义显示频率(每X根K线)
- 对香港期货有特殊处理(在开市时重置)
- 根据时间周期(日线、周线、月线)使用不同的重置逻辑
- 可自定义文字大小和颜色

3. EMA指标:
- 可自定义周期长度(默认:20)
- 可选择使用不同的时间周期进行计算
- 可选择等待时间周期结束以获得更稳定的信号
- 可自定义线条颜色

使用说明:
- 将指标添加到图表后,在"格式"面板中自定义设置
- 日期显示表格将出现在您选择的图表位置
- K线序号将按您指定的频率显示在价格K线下方
- EMA线将根据您选择的设置绘制在图表上
- 颜色会根据浅色/深色图表主题自动调整
*/
Catatan Rilis
# Multi-Function Trading Indicator: Date Display, Bar Counter, and EMA

## English Description

### Overview
This versatile indicator combines three essential trading tools in one package: a customizable date display, an intelligent bar counter that adapts to different markets, and an Exponential Moving Average (EMA). Designed for traders who need clean, informative chart overlays without cluttering their workspace.

### Key Features

#### 1. Smart Date Display
- Shows current date in either full format (Monday · January 1, 2023) or compact format (Mon · 01.01.23)
- Optional day of week display
- Symbol and timeframe information display
- Fully customizable table position, size, and colors that automatically adapt to light/dark chart themes

#### 2. Intelligent Bar Counter
- Counts bars from market open, automatically resetting at the appropriate time
- **Enhanced Market Detection**: Automatically identifies and adapts to different markets:
- **US Futures Markets**: Precisely resets at market open (9:30 AM ET for NY-based exchanges or 8:30 AM CT for Chicago-based exchanges)
- **Hong Kong Futures**: Resets at 9:15 AM HKT
- **Other Markets**: Resets at day change
- Supports all timeframes including intraday, daily, weekly, and monthly
- Customizable display frequency and appearance

#### 3. EMA Indicator
- Configurable period length
- Optional multi-timeframe analysis
- Choice between waiting for candle close or dynamic updates
- Customizable color

### Usage Instructions
1. Add the indicator to your chart
2. Configure the appearance settings for each component
3. For futures trading, the indicator will automatically detect the market type and adjust the bar counter reset time accordingly

### Perfect For
- Day traders tracking intraday movements
- Futures traders working across multiple markets
- Anyone who needs clear visual references for time and price movement

## Chinese Description (中文描述)

### 概述
这款多功能指标集成了三种基本交易工具:可自定义的日期显示、智能适配不同市场的K线计数器和指数移动平均线(EMA)。专为需要清晰、信息丰富且不占用过多图表空间的交易者设计。

### 主要功能

#### 1. 智能日期显示
- 支持完整格式(星期一 · 一月 1, 2023)或简洁格式(周一 · 01.01.23)的日期显示
- 可选择是否显示星期几
- 可显示交易品种和时间周期信息
- 完全可自定义的表格位置、大小和颜色,自动适应明/暗主题

#### 2. 智能K线计数器
- 从市场开盘时开始计数,在适当时间自动重置
- **增强的市场检测**:自动识别并适配不同市场:
- **美国期货市场**:在市场开盘时精确重置(纽约交易所为东部时间9:30,芝加哥交易所为中部时间8:30)
- **香港期货**:在香港时间9:15重置
- **其他市场**:在日期变更时重置
- 支持所有时间周期,包括日内、日线、周线和月线
- 可自定义显示频率和外观

#### 3. EMA指标
- 可配置周期长度
- 可选多时间周期分析
- 可选择等待K线收盘后计算或动态更新
- 可自定义颜色

### 使用说明
1. 将指标添加到您的图表
2. 配置各组件的外观设置
3. 对于期货交易,指标将自动检测市场类型并相应调整K线计数器的重置时间

### 适用人群
- 跟踪日内行情的日内交易者
- 在多个市场交易期货的交易者
- 任何需要清晰的时间和价格走势视觉参考的人

---

This indicator is open-source and free to use. If you find it helpful, please consider giving credit to the original author.

指标代码开源免费使用。如果您觉得它有用,请考虑给原作者一个赞赏。

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.