OPEN-SOURCE SCRIPT

Stock Reference Data - Daily

202
Description
A compact, on-chart reference panel for stocks. Shows 20-day average volume, ATR (14), and ATR as a percentage of price in a fully configurable table, and drops an "📊 Earnings" label on bars where an earnings release occurred. Designed for the daily timeframe.

How it works
The indicator computes three metrics on every bar and renders them in a table on the most recent bar:

20 Day Avg Vol — A 20-period simple moving average of volume, formatted with K / M / B suffixes for readability.
ATR (14) — Pine's built-in 14-period Average True Range, the standard short-term volatility measure.
ATR % — ATR(14) expressed as a percentage of the current close. This normalizes volatility across stocks at different price levels, so you can compare a $20 stock and a $400 stock on equal footing.

Separately, the indicator calls request.earnings() to detect bars where an earnings event was reported. When one is found on the most recent bar, an orange "📊 Earnings" label is placed above the bar's high.
The table is created once and updated only on the last bar (barstate.islast), so there is no historical clutter and no per-bar drawing overhead.
Inputs

Table Position — Vertical (top / middle / bottom) and Horizontal (left / center / right). All 9 placements are supported.
Table Appearance — Background color, font color, and font size (tiny / small / normal / large / huge).

Recommended usage
Apply on a daily chart. Best paired with a price-action or trend setup where you want quick context on liquidity (volume), volatility (ATR / ATR %), and event risk (earnings).

Release notes — v1.1

Added configurable table position — vertical (top / middle / bottom) and horizontal (left / center / right), giving 9 placement options.
Added configurable background color, font color, and font size.
Removed the Market Cap row from the table.
Renamed the indicator to "Stock Reference Data - Daily" to reflect its intended timeframe.
Refactored position and size mapping to use switch expressions, fixing a Pine v5 line-continuation issue.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.