OPEN-SOURCE SCRIPT
ที่อัปเดต: 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
เอกสารเผยแพร่
### 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
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน