OPEN-SOURCE SCRIPT
Telah dikemas kini Stock Reference Data - Weekly

# 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.
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.
Nota Keluaran
Added FINRA short volume %Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.