OPEN-SOURCE SCRIPT
Updated 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
Release Notes
### 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
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.