OPEN-SOURCE SCRIPT

Bar metrics / quantifytools

Updated
— Overview

Rather than eyeball evaluating bullishness/bearishness in any given bar, bar metrics allow a quantified approach using three basic fundamental data points: relative close, relative volatility and relative volume. These data points are visualized in a discreet data dashboard form, next to all real-time bars. Each value also has a dot in front, representing color coded extremes in the values.

Relative close represents position of bar's close relative to high and low, high of bar being 100% and low of bar being 0%. Relative close indicates strength of bulls/bears in a given bar, the higher the better for bulls, the lower the better for bears. Relative volatility (bar range, high - low) and relative volume are presented in a form of a multiplier, relative to their respective moving averages (SMA 20). A value of 1x indicates volume/volatility being on par with moving average, 2x indicates volume/volatility being twice as much as moving average and so on. Relative volume and volatility can be used for measuring general market participant interest, the "weight of the bar" as it were.

— Features

Users can gauge past bar metrics using lookback via input menu. Past bars, especially recent ones, are helpful for giving context for current bar metrics. Lookback bars are highlighted on the chart using a yellow box and metrics presented on the data dashboard with lookback symbols:

snapshot

To inspect bar metric data and its implications, users can highlight bars with specified bracket values for each metric:

snapshot

When bar highlighter is toggled on and desired bar metric values set, alert for the specified combination can be toggled on via alert menu. Note that bar highlighter must be enabled in order for alerts to function.

— Visuals

Bar metric dots are gradient colored the following way:

Relative volatility & volume
0x -> 1x / Neutral (white) -> Light (yellow)
1x -> 1.7x / Light (yellow) -> Medium (orange)
1.7x -> 2.4x / Medium (orange) -> Heavy (red)

Relative close
0% -> 25% / Heavy bearish (red) -> Light bearish (dark red)
25% -> 45% / Light bearish (dark red) -> Neutral (white)
45% - 55% / Neutral (white)
55% -> 75% / Neutral (white) -> Light bullish (dark green)
75% -> 100% / Light bullish (dark green) -> Heavy bullish (green)

All colors can be adjusted via input menu. Label size, label distance from bar (offset) and text format (regular/stealth) can be adjusted via input menu as well:

snapshot

— Practical guide

As interpretation of bar metrics is highly contextual, it is especially important to use other means in conjunction with the metrics. Levels, oscillators, moving averages, whatever you have found useful for your process. In short, relative close indicates directional bias and relative volume/volatility indicates "weight" of directional bias.

General interpretation

High relative close, low relative volume/volatility = mildly bullish, bias up/consolidation
High relative close, medium relative volume/volatility = bullish, bias up
High relative close, high relative volume/volatility = exuberantly bullish, bias up/down depending on context

Medium relative close, low relative volume/volatility = noise, no bias
Medium relative close, medium to high relative volume/volatility = indecision, further evidence needed to evaluate bias

Low relative close, low relative volume/volatility = mildly bearish, bias down/consolidation
Low relative close, medium relative volume/volatility = bearish, bias down
Low relative close, high relative volume/volatility = exuberantly bearish, bias down/up depending on context

Nuances & considerations

As to relative close, it's important to note that each bar is a trading range when viewed on a lower timeframe, ES 1W vs. ES 4H:

snapshot

When relative close is high, bulls were able to push price to range high by the time of close. When relative close is low, bears were able to push price to range low by the time of close. In other words, bulls/bears were able to gain the upper hand over a given trading range, hinting strength for the side that made the final push. When relative close is around middle range (40-60%), it can be said neither side is clearly dominating the range, hinting neutral/indecision bias from a relative close perspective.

As to relative volume/volatility, low values (less than ~0.7x) imply bar has low market participant interest and therefore is likely insignificant, as it is "lacking weight". Values close to or above 1x imply meaningful market participant interest, whereas values well above 1x (greater than ~1.3x) imply exuberance. This exuberance can manifest as initiation (beginning of a trend) or as exhaustion (end of a trend):

snapshot

snapshot
Release Notes
Update

Basket average
Up to 10 symbols can be selected to form a basket average of all three metrics. Basket average can be used to give context for bar metrics of any individual chart. When enabled, basket average will be displayed next to chart bar metrics.

Example #1: Diverging metrics

When using a basket of highly correlating and comparable symbols in conjunction with chart bar metrics, ideally you want to see them in agreement. If metrics of the viewed chart diverge significantly from broader market (basket average), bias suggested by metrics is likely noise. Always better to sail with the winds than against.

snapshot

Visuals
Bar metrics can now also be displayed in a table form. Size and position of table can be adjusted via input menu.

snapshot
Release Notes
Update

Fixed typo causing incorrect symbols being included in basket average
Release Notes
Update

Smoothing method and length used in relative volume/volatility calculations can now be customized
Release Notes
Updated license
barmetricsquantifytoolsrelativecloserelativevolatilityrelativevolumeVolatilityVolume

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


✨ Get instant access to Premium Toolstack for Free: Liquidity prints, Price based concepts and Liquidity composition

✨ Start 7-Day Free Trial: quantify.tools

Watch video tutorials covering our tools on Youtube ↓
Also on:

Disclaimer