OPEN-SOURCE SCRIPT
Atualizado OHLC Horizontal Compact + Volume + Buy/Sell

A compact, single-row horizontal table for TradingView displaying Open, High, Low, Close (OHLC), net change, percentage change, volume, and buy/sell pressure percentages. The table is fully color-coded for easy interpretation: green for positive values, red for negative, and yellow for neutral. Table position is fully customizable (top, middle, bottom / left, center, right). Ideal for traders who want a concise, real-time snapshot of price action and market sentiment in a single row.
Features:
OHLC values in one horizontal row
Net change (Δ) and % change with directional arrows
Real-time volume display
Buy/Sell pressure % with dynamic coloring
Fully customizable table placement
Works on all timeframes
Features:
OHLC values in one horizontal row
Net change (Δ) and % change with directional arrows
Real-time volume display
Buy/Sell pressure % with dynamic coloring
Fully customizable table placement
Works on all timeframes
Notas de Lançamento
### 1. 📛 Indicator Name
- **Old**: `"OHLC Horizontal Compact + Volume + Buy/Sell"`
- **New**: `"OHLC Compact + Volume + Buy/Sell + Separators"`
- **Change**: The new version adds "Separators" to the name, reflecting a visual enhancement.
---
### 2. 📍 Table Positioning
- **Old**: Uses `i_tab1Ypos + "_" + i_tab1Xpos` as a string to define position.
- **New**: Maps `i_tab1Ypos` and `i_tab1Xpos` to the `position` enum for more precise placement.
- **Improvement**: More robust and readable positioning logic.
---
### 3. 🧱 Table Structure
- **Old**: Table with 9 columns (one per data point).
- **New**: Table with 17 columns (9 data points + 8 separators).
- **Improvement**: Adds visual separators between data points for better readability.
---
### 4. 🔣 Separator Customization
- **Old**: No separators.
- **New**: Adds `sepChar` input to choose separator style (e.g., `│`, `|`, `•`, etc.).
- **Improvement**: Enhances visual clarity and user customization.
---
### 5. 🧮 Buy/Sell Calculation Robustness
- **Old**: Assumes `high - low` is non-zero.
- **New**: Adds `rangeIsZero` check to avoid division by zero when `high == low`.
- **Improvement**: Prevents runtime errors and ensures stability.
---
### 6. 🧠 Percent Change Safety
- **Old**: `(netChange / open[1]) * 100` without checking if `open[1]` is zero.
- **New**: Adds condition `open[1] != 0 ? ... : na`.
- **Improvement**: Avoids division by zero and handles edge cases gracefully.
---
### 7. 🧩 Modular Layout
- **Old**: Direct `table.cell` calls for each data point.
- **New**: Uses helper functions `addData()` and `addSep()` for cleaner layout logic.
- **Improvement**: More maintainable and readable code.
---
### 8. 🎨 Visual Enhancements
- **Old**: Basic layout with consistent background.
- **New**: Adds separators with distinct color (`sepCol`) and customizable character.
- **Improvement**: More polished and user-friendly interface.
---
### 9. 🧾 Minor Renaming
- Variable and group names are slightly renamed for clarity:
- `tab1` → `tab`
- `GP1` → `groupPos`
---
## ✅ Summary
The updated script introduces:
- Better layout with separators
- Safer calculations
- Cleaner code structure
- Enhanced customization options
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.