Investment Studio > Expressions > Functions > Indicator > UDR

float array[*][2] udr(float array[*][3] dcv, integer days)

Returns a two-column array containing dates (first column) and corresponding Up/Down volume Ratio (UDR) values (second column). Given n input rows in dcv, n - days (or fewer) rows are returned.

dcv is a three-column array containing daily price quotes. Each row is structured as follows:

Column # Content
1 The quote date.
2 The day's close (last traded price).
3 The day's volume (number of traded shares).

The array is assumed to be time-sorted, with earlier dates preceding later dates.

Automatic type conversion allows the use of date strings as arguments instead of explicit date values.

days > 0 is the number of trading days over which up and down volumes are summed and compared.

Interpretation

UDR is a measure of the direction and strength of recent share flows.

If the day's close is higher than the previous trading day's close, most of the day's volume is assumed to be associated with upward price movement (accumulation, indicating a demand-driven market) and is therefore considered "up" volume. If the day's close is lower than the previous trading day's close, most of the day's volume is assumed to be associated with downward price movement (distribution, indicating a supply-driven market) and is therefore considered "down" volume.

UDR is the ratio of total up volume to total down volume over the latest trading days. As such, it will oscillate around 1. Values between 0 and 1 indicate that selling pressure is prevailing; values above 1 that demand is dominating. Note that a linear plot of UDR will not result in a symmetric view of both sides. For that, use a logarithmic plot or MFI-style scaling, i.e. 100 - 100 / (1 + UDR).

For the difference (rather than the ratio) between up and down volume, use OBV instead.

Note that the attribution of each day's entire volume to one side or the other (all up or all down) is almost certain to be wrong. This is done for no better reason than lack of more detailed information. The assumption is that on average, the result will be roughly proportional to the actual net flows (see ACD and PVT for alternate guesstimates). UDR is therefore mainly useful in the absence of tick-by-tick data showing the price and number of shares traded in each transaction over the course of the trading day (and hence the actual net flow in the asset) or at least of actual upside/downside volume data.

Heavy volume accompanied by a clear price direction is a sign of conviction among market participants. If price is up on heavy volume, the market is demand-driven: buyers are prepared to pay more in order to entice reluctant sellers (both sides think the asset is worth more). Such a day will give the UDR a significant push up. If price is down on heavy volume, the market is supply-driven: sellers are prepared to reduce their demands in order to entice reluctant buyers (both sides think the asset is worth less). Such a day will give the UDR a significant push down. Light volume on the other hand means that there is a divergence of opinions: sellers think the asset is worth more, buyers that it's worth less, so supply and demand meet more rarely. Whether price ends up or down, such days move the UDR less than heavy volume days.

Waning conviction (declining demand in an uptrend, declining supply in a downtrend) will therefore cause price to pull away from UDR. This is a warning sign that the current price trend may be running out of steam. A divergence initiated by price (price trend reversal without UDR trend reversal) is considered "non-confirmation" and should be viewed with suspicion until UDR follows (or the previous price trend is resumed); a divergence initiated by UDR (UDR trend reversal without price trend reversal) is considered a strong warning that the price trend is about to reverse itself.

For a real life example, consider Apple (NASD:AAPL) from January 1, 2001 to December 31, 2001:

The top chart shows daily prices in standard candlestick form; the middle chart shows daily volume; the bottom chart shows the 10 day UDR (red) and its 10 day EMA (blue).

Compare the bottom chart with the corresponding OBV chart.

Example

Assuming standard US date format settings,

=udr({{"1/1/1990", 98, 1000}, {"1/2/1990", 86, 800}, {"1/3/1990", 88, 900}}, 2)

returns {{32876, 1.125}}. 32876 is the date code for 1/3/1990; 1.125 is the 2 day UDR for that date, i.e. the ratio between the up volume 0 + 900 = 900 and the down volume 800 + 0 = 800. The first input day only contributes to the calssification of the second input day as up or down.

See also acd, efi, eom, mfi, mo, nvi, pvi, pvt.