DYORLearn hubBlog
Home / Learn hub / Metrics Builder

Metrics Builder: compare two metrics

8 min · DYOR Education
PRORight rail
Goal

Cover the “Compare two metrics” mode: operations on a pair and normalization.

Metrics Builder, “Compare two metrics” mode: Metric A, Metric B, operation, normalization, “Preview”, “Add Indicator”
Metrics Builder, “Compare two metrics” mode: Metric A, Metric B, operation, normalization, “Preview”, “Add Indicator”
What it shows

Two metrics in one line.

  1. Each metric is built as in “Single metric” mode.
  2. An operation is applied to the pair: difference, ratio, correlation and others.
  3. The result is normalized so that different units — dollars and percent — can be compared.

The second layer of the same idea. In “Single metric” mode the formula asks one number a question. Here it asks about the link between two numbers: spot to futures, bids to asks, OI to price. There's no such metric in the indicator list; you build it yourself. On top — the same normalization: how unusual the link is now relative to its own history.

Metric Asource · fieldMetric Bsource · fieldOperationA − B, A ÷ B…NormalizationZ-Score · PercentileIndicatorRaw · RSI…one line on the chart
Each box is a field in the panel. Left to right, as in the form.
What it's for

Link two values on one scale: near bids with far asks, spot with futures, OI with price.

For example.

  • Metric A — bids at 1.5%. Metric B — asks at 8%. Operation Ratio, normalization Percentile.
  • Result 95: the ratio of near bids to far asks is now higher than in 95% of the last hundred bars.
  • It's the same anomaly from DIFF SMART, but compared with the coin's own history.
Where to find it

Right rail → Metrics Builder → mode Compare two metrics.

Settings
FieldOptionsDefaultWhat it changes
Metric A, Metric Bany two sources—What to compare.
Each is built as in “Single metric” mode.
Operation10 options, table below—How to combine A and B into one number.
NormalizationNo normalization
Z-Score
Percentile
Z-ScoreBring both metrics to one scale over a 100-bar window: Z-Score — how many standard deviations the value has moved from its window average: 0 — as usual, ±2 — rare, ±3 — very rare.
Percentile — what percent of values in the window are below the current one: 50 — the middle, 95 — almost the maximum.

- Want to compare metrics of different scale — Z-Score, the safe choice.
- Want robustness to outliers — Percentile.
No normalization — only if both metrics are already on one scale.
Stabilityoff
on
offShow the operation's stability instead of its value, from 0 to 100.
The window is split into sub-windows (4 by default), and the operation is computed in each one anew.
The answer is the share of sub-windows where the direction matched the direction over the whole window.
Dead zone and neutral are set in the operation's units.
Indicatoras in “Single metric” modeZ-ScoreA classic indicator on top of the result, with its own parameters, e.g. period 20.
Previewpreview—The build in one line: operation, sources and fields, normalization, stability, indicator.
Then “Add Indicator”.

Operations

OperationFormulaWhat it shows
DivergenceA − BHow far the metrics diverged, with sign.
Divergence Abs|A − B|The gap between A and B, without direction.
CompositeA + BTotal pressure when both metrics point the same way.
AlignmentA × BPlus — both point the same way.
Minus — conflict.
RatioA ÷ BRatio of A to B.
Relative DivergenceA − B divided by the size of A and BDivergence relative to the combined size, from −1 to +1.
Divergence MomentumΔA − ΔBWhich metric is moving faster right now.
Correlationcorrelation of ΔA and ΔBPearson correlation of increments over the period (100 bars), from −1 to +1.
Spearman ICrank correlation of A with future BDoes A lead B.
B is usually the price (the “Price” source).
Each bar pairs A from horizon bars back with the change in B since then.
From −100 to 100: plus — high A precedes a rise, minus — a fall.
Tail Edgeaverage move of B after A's tailsWhat B does after extreme values of A: the move after the upper tail minus the move after the lower one, in percent.
Low N / High N in the legend — how many bars each tail collected.

Spearman IC and Tail Edge parameters

FieldOptionsDefaultWhat it changes
Horizon (bars)1 … 50012How many bars ahead to look at B's move.
Window (bars)12 … 2000500Over how many bars to collect pairs.
Min samples3 … 100012With fewer pairs the value isn't computed.
Spearman IC only.
Low tail (A ≤), High tail (A ≥)bounds5 and 95A's tail bounds after normalization.
Tail Edge only.
Min tail samples1 … 100010A thin tail gives no number.
Tail Edge only.

With Z-Score the pane gets levels ±3, ±2, 0. With Percentile — 95 / 75 / 50 / 25 / 5. The levels always stay in the pane's view; to turn this off, use “Levels in autoscale” in the indicator menu.

The normalization window boundary on the chart is shown by the Bars Back Lines indicator (indicators window → TECHNICAL → Overlays). It draws up to four vertical lines N bars back from the current one. Zero in a field turns a line off.

Metric A and Metric B: source Order Book, source settings Exchange Type SPOT and FUTURES, Depth % 3%, field Bids/Asks
Metric A and Metric B: source Order Book, source settings Exchange Type SPOT and FUTURES, Depth % 3%, field Bids/Asks
Operation Ratio, Stability: windows 4, window 500, dead zone 0, neutral 1. Normalization Z-Score with period 100, indicator Z-Score with period 20
Operation Ratio, Stability: windows 4, window 500, dead zone 0, neutral 1. Normalization Z-Score with period 100, indicator Z-Score with period 20
“Preview”: the build in one line and the “Add Indicator” button
“Preview”: the build in one line and the “Add Indicator” button
In alerts

Yes, via the Metric pair entry in the “Metric” list: the same Metric A / B, operation and normalization. Covered in the “Alerts” block.

Try it yourself
  1. “Compare two metrics” mode: A — Order Book Bids/Asks SPOT 3%, B — the same on FUTURES 3%, operation Ratio, normalization Z-Score.
  2. Add it to the chart and see where the line goes beyond ±2.
What you should get. You compared spot and futures skew in one line and saw when they diverge more than usual.
Paid feature.
Takeaway

Two metrics are joined by an operation: difference, sum, product, ratio, correlation and others. The result is normalized so dollars and percent land on one scale. Z-Score — how many deviations from its own average. Percentile — its place in its own history over 100 bars. It's your own indicator from two sources: a link that isn't in the ready-made list, and an answer to how unusual it is now.

Quick check

Why does comparing two metrics need normalization?

Show answer

Correct answer: To bring metrics with different units to one scale

← Previous lesson Next lesson →
See these concepts live on real Binance data — the DYOR workspace is free to start.
Open DYOR Platform