R-Squared Indicator: Formula, Settings and How to Read It
R-Squared reports the share of the last N closes' variance that a straight line through time explains, on a scale from 0 to 1. It describes how well a linear trend fits the window, not which direction that trend points.
Senzoukria · Indicators · Updated September 2026
R-Squared ships with the Senzoukria desktop app, in the Momentum group of the indicator catalogue. It is drawn in its own panel below the chart.
What R-Squared measures
It is the coefficient of determination of exactly the same least-squares fit that the Linear Regression Slope plots, so the two are meant to be read together: this one gives the quality of the fit, the slope gives its direction and steepness. A reading of 0.9 looks identical whether the window rose or fell. When the window has zero variance - every close identical - there is nothing for a line to explain, and the indicator returns no value rather than 0 or 1. The result is clamped to 1 at the top, because floating-point rounding on a perfectly straight window can otherwise overshoot. The default period is 20 bars.
The formula, as implemented
This is not a description of how the indicator is usually defined elsewhere — it is what the shipped code computes, documented next to the implementation:
Coefficient de détermination de la MÊME régression : R² = Sxy² / (Sxx · Syy) ∈ [0, 1] Part de la variance des closes expliquée par le temps — la QUALITÉ de la tendance, pas son sens (0.9 se lit pareil en hausse et en baisse ; le sens se lit sur `linreg-slope`). Syy = 0 (fenêtre plate → VARIANCE NULLE) → null, jamais 0 ni 1 : sans variance à expliquer, R² n'existe pas. Borné dur à 1 (arrondi f64 sur une droite parfaite). Défaut N=20.
How to read it
- High values mean the closes in the window line up along a straight path; combine with the slope's sign to know whether that path rises or falls.
- A rising R-Squared describes a window becoming more linear, which can happen while price advances or while it declines.
- Low values do not mean no movement - they mean a straight line is a poor description of the window, which covers both a flat chop and a sharp V-shaped reversal.
- A high R-Squared paired with a near-zero slope describes a very orderly sideways drift, not a trend.
- Judge readings against the window length: at the minimum period of 2 a line passes through both points and the value is 1 by construction, and short windows stay close to that.
Parameters and defaults
Period defaults to 20 and accepts 2 to 500, and it must match the Linear Regression Slope's period if the two are being read as a pair. Short windows produce high values frequently and carry little evidence; long windows make a high reading a stronger statement about the window's structure.
| Parameter | Type | Default | Range |
|---|---|---|---|
| Period | number | 20 | 2 – 500 |
What it does not show
R-Squared only ever tests a straight line. A smooth accelerating curve or a flat stretch broken by one large gap can both score high while looking nothing like a straight advance on the chart. It is scale-free, so it never indicates how large the move was - a one-tick drift and a hundred-point run can both score above 0.9. It uses closes only, ignores volume and order flow entirely, and says nothing about whether the fitted line will continue. Short periods are the main trap: with a handful of points, a high score is close to arithmetically inevitable.
Using it in Senzoukria
Add it from the Indicators panel of any footprint chart or candle chart. It runs on futures data from Rithmic or Databento and on crypto pairs from Binance and Bybit, on the same engine — the calculation does not change with the venue, only the data feeding it does. Market data subscriptions are billed by the provider, separately from the app.
Related indicators
See the full indicator library, or start with the order flow guide if you are new to reading aggression, delta and absorption.
Frequently asked questions
- What does R-Squared measure on a price chart?
- It measures how much of the variation in the last N closes is explained by a straight line fitted against time, from 0 to 1. It is a measure of linearity, not of direction or size - the same value can describe a rising window and a falling one.
- Does a high R-Squared mean a strong trend?
- It means an orderly one. A window can fit a line almost perfectly while moving only a few ticks, which scores high without being a meaningful move. Read it next to the regression slope, which supplies the direction and the steepness the R-Squared deliberately omits.
- Why is there no R-Squared value on a flat window?
- The coefficient divides by the variance of the closes. When every close in the window is identical that variance is zero, so there is no variation for a line to explain and the ratio is undefined. The indicator withholds the value rather than reporting 0 or 1, either of which would be a fabricated reading.