OPEN-SOURCE SCRIPT
Updated

VR Volume Ratio + Divergence (Pro)

546
成交量比率 (Volume Ratio, VR) 是一項通過分析股價上漲與下跌日的成交量,來研判市場資金氣氛的技術指標。本腳本基於傳統 VR 公式進行了優化,增加了**「趨勢變色」與「自動背離偵測」**功能,幫助交易者更精準地捕捉量價轉折點。

[EN] Introduction
Volume Ratio (VR) is a technical indicator that measures the strength of a trend by comparing the volume on up-days versus down-days. This script enhances the classic VR formula with "Trend Color Coding" and "Auto-Divergence Detection", helping traders identify volume-price reversals more accurately.

[TW] 核心功能與參數
公式原理: VR = (Qu + Qf/2) / (Qd + Qf/2) * 100

Qu: 上漲日成交量 (Up volume)

Qd: 下跌日成交量 (Down volume)

Qf: 平盤日成交量 (Flat volume)

參數 (Length):預設為 26 日,這是市場公認最有效的短中線參數。

關鍵水位線 (Key Levels):

< 40% (底部區):量縮極致,市場情緒冰點,常對應股價底部,適合尋找買點。

100% (中軸):多空分界線。

> 260% (多頭警戒):進入強勢多頭行情,但需注意過熱。

> 450% (頭部區):成交量過大,市場情緒亢奮,通常為頭部訊號。

視覺優化 (Visuals):

紅漲綠跌:當 VR 數值大於前一日顯示為紅色(動能增強);小於前一日顯示為綠色(動能退潮)。

背離訊號 (Divergence):自動標記量價背離。

▲ 底背離 (Bullish):股價創新低,但 VR 指標墊高(主力吸籌)。

▼ 頂背離 (Bearish):股價創新高,但 VR 指標走弱(買氣衰竭)。

[EN] Features & Settings
Formula Logic: Calculated as VR = (Qu + Qf/2) / (Qd + Qf/2) * 100.

Default Length: 26, widely regarded as the optimal setting for short-to-medium term analysis.

Key Zones:

< 40% (Oversold/Bottom): Extreme low volume, often indicating a market bottom and potential buying opportunity.

100% (Neutral): The balance point between bulls and bears.

> 260% (Bullish Zone): Strong uptrend, volume is expanding.

> 450% (Overbought/Top): Extreme high volume, often indicating a market top and potential reversal.

Visual Enhancements:

Color Coding: Line turns Red when VR rises (Momentum Up) and Green when VR falls (Momentum Down).

Divergence Signals: Automatically marks divergence points on the chart.

▲ Bullish Divergence: Price makes a lower low, but VR makes a higher low (Accumulation).

▼ Bearish Divergence: Price makes a higher high, but VR makes a lower high (Distribution).

[TW] 應用策略建議
抄底策略:當 VR 跌破 40% 後,指標線由綠翻紅,或出現「▲底背離」訊號時,為極佳的波段進場點。

逃頂策略:當 VR 衝過 450% 進入高檔區,一旦指標線由紅翻綠,或出現「▼頂背離」訊號時,建議分批獲利了結。

[EN] Strategy Guide
Bottom Fishing: Look for entries when VR drops below 40% and turns red, or when a "▲ Bullish Divergence" label appears.

Taking Profit: Consider selling when VR exceeds 450% and turns green, or when a "▼ Bearish Divergence" label appears.

Disclaimer: This tool is for informational purposes only and does not constitute financial advice. / 本腳本僅供參考,不構成投資建議。
Release Notes
[TW] 資訊面板 (HUD) 說明
我們專為追求視覺美感的交易者設計了**「抬頭顯示器 (HUD) 資訊面板」。這個面板不會像傳統表格那樣破壞圖表的整潔度,而是以懸浮、動態配色**的極簡風格,將關鍵數據即時顯示在指標視窗的右側空白處。

核心顯示內容:
VR 即時數值 (Real-time VR Value)

以最大的字體顯示當前最新的 VR 數值,讓您一眼掌握市場的強弱位階。

變動趨勢與量化 (Change in Trend)

在數值下方,會顯示當日 VR 相較於前一天的變化量。

使用 ▲ (增加) 或 ▼ (減少) 符號。

同時顯示數值差異和百分比差異,精確量化多空動能的變化速度。

視覺設計原則:
動態配色 (Dynamic Coloring):整個面板的文字顏色與 VR 線條的趨勢同步。

紅色 (Red):代表 VR 數值較前一日增加(多方動能增強)。

綠色 (Green):代表 VR 數值較前一日減少(多方動能減弱/空方勢頭增長)。

優雅的懸浮感 (Minimalist Float):面板完全透明,無邊框、無背景,讓數據如同「浮水印」般懸浮於圖表右側,保持極高的視覺清潔度。

高度客製化 (Customizable Position):使用者可以自由設定面板的垂直位置(上、中、下)以及顯示大小(小、中、大),以適應不同的螢幕解析度與排版需求。

[EN] HUD Panel Description
We have introduced a Head-Up Display (HUD) Info Panel tailored for traders who prioritize visual clarity and aesthetics. This panel moves beyond typical grid-based tables, presenting essential data in a minimalist, floating design with dynamic coloring on the right-hand side of the indicator window.

Key Information Displayed:
Real-time VR Value

The current VR value is displayed in the largest font, allowing for instant recognition of the market's current strength or weakness.

Change in Trend and Quantification

Below the main value, the panel shows the daily change in VR compared to the previous day.

Uses ▲ (Increase) or ▼ (Decrease) symbols.

Displays both the absolute difference and the percentage difference, providing precise quantification of momentum shift.

Design Philosophy:
Dynamic Coloring: The text color of the entire panel synchronizes with the VR line trend.

Red: Indicates VR value increased from the previous day (Bullish momentum is strengthening).

Green: Indicates VR value decreased from the previous day (Bullish momentum is weakening / Bearish pressure is increasing).

Minimalist Float: The panel is fully transparent with no borders or background, ensuring maximum visual cleanliness by letting the data float like a "watermark" on the chart.

High Customization: Users can easily adjust the panel's vertical position (Top, Middle, Bottom) and display size (Small, Normal, Large) in the settings to perfectly fit their screen layout and preference.

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.