OPEN-SOURCE SCRIPT
Telah dikemas kini 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
Nota Keluaran
### 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
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.