OPEN-SOURCE SCRIPT
Cập nhật

Stock Reference Data - Weekly

149
# Stock Reference Data - Weekly

Requirements and reference document for the `Stock Reference Data - Weekly.pine` TradingView indicator.

## Description

A compact, on-chart reference panel for stocks intended for the weekly timeframe. Shows Market Cap and the company's Sector in a fully configurable table, and drops an "📊 Earnings" label on bars where an earnings release occurred.

## How it works

The indicator pulls two pieces of fundamental / reference data and renders them in a table on the most recent bar:

- **Market Cap** — Computed as `TOTAL_SHARES_OUTSTANDING (FQ) × close`. Total shares outstanding is fetched via `request.financial()` for the most recent fiscal quarter, then multiplied by the current close. The result is formatted with K / M / B / T suffixes for readability (e.g. `2.85T`, `412.5B`).
- **Sector** — Pulled directly from `syminfo.sector`, which is the sector classification TradingView associates with the symbol (e.g. *Technology Services*, *Finance*, *Energy Minerals*). Falls back to `N/A` for symbols where the sector is not populated (e.g. ETFs, indices, crypto).

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 Position — `top` / `middle` / `bottom` (default: `top`)
- Horizontal Position — `left` / `center` / `right` (default: `right`)

All 9 corner/edge placements are supported.

**Table Appearance**

- Background Color (default: black at 80% transparency)
- Font Color (default: black)
- Font Size — `tiny` / `small` / `normal` / `large` / `huge` (default: `small`)

## Recommended usage

Apply on a weekly chart. Best used as a "reference card" alongside a long-term trend or position-sizing setup, where market-cap tier (large vs. mid vs. small cap) and sector classification matter for context — for example, when comparing setups across watchlists or rotating between sectors.

## Release notes

### v1.0

- Initial release. Top-right table showing Market Cap and Sector.
- Configurable table position (9 placements), background color, font color, and font size.
- Earnings label on the most recent bar when an earnings event is detected.
Phát hành các Ghi chú
Added FINRA short volume %

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.