OPEN-SOURCE SCRIPT
Atualizado 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.
Notas de Lançamento
Added FINRA short volume %Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.