OPEN-SOURCE SCRIPT
Stock Reference Data - Daily

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.
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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน