Shannon Entropy Indicator: Formula, Settings and How to Read It
Shannon Entropy measures how spread out recent returns are, reported in bits. Senzoukria discretises the last N returns into equal-width bins spanning the window's own range and computes the entropy of that distribution, which is bounded between 0 and the base-2 logarithm of the bin count.
Senzoukria · Indicators · Updated September 2026
Shannon Entropy ships with the Senzoukria desktop app, in the Volatility group of the indicator catalogue. It is drawn in its own panel below the chart.
What Shannon Entropy measures
Bin width is the window's range — largest return minus smallest — divided by the number of bins, so the scale comes from the data rather than from fixed tick thresholds, which makes the figure comparable across instruments. Each return falls into a bin, the counts become probabilities, and the entropy is computed with base-2 logarithms. With the default of 8 bins the maximum possible reading is 3 bits, reached when returns spread evenly across every bin; a value near zero means almost all returns landed in one bin. The window maximum, which would otherwise fall into a bin beyond the last, is folded into the final bin, the usual right-closed convention. A window in which every return is identical returns no value, because the bin edges are then undefined and reporting zero bits would assert a result from a binning that does not exist.
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:
Entropie de Shannon des N derniers rendements, discrétisés en B paniers de LARGEUR ÉGALE sur l'étendue de la fenêtre, résultat en BITS : largeur = (max − min)/B ; panier(r) = min(B−1, ⌊(r − min)/(max−min)·B⌋) p_b = compte_b / N ; H = −Σ_b p_b · log₂ p_b (p_b = 0 ignoré) Bornes : H ∈ [0, log₂B] — 3 bits au maximum avec le défaut B=8. Lecture : H proche du max = rendements étalés/imprévisibles ; H bas = régime concentré (le marché fait toujours le même pas). Paniers sur l'ÉTENDUE de la fenêtre (pas des bornes fixes en ticks) : la mesure devient sans échelle, comparable entre MNQ et 6E — c'est aussi ce qui la rend insensible au tick size, que la famille ne consomme pas. Le max de la fenêtre tomberait sur le panier B (hors tableau) : il est rabattu sur B−1, la convention habituelle du binning à droite fermée. Fenêtre CONSTANTE (max == min) → null : les bornes des paniers sont indéfinies (0/0) et « 0 bit » serait déduit d'un binning qui n'existe pas — règle du catalogue, dénominateur nul → null. Défauts B=8, N=50.
How to read it
- A reading close to the ceiling — 3 bits with the default settings — describes returns scattered across the whole observed range: the market is not repeating the same step size.
- A low reading describes a concentrated regime where most bars produce a similar return, which happens both in a quiet range and in a steady, mechanical trend.
- The value is relative to the window's own extremes, so entropy can be high in a calm period and low in a violent one. Read it as a shape measure, not as a volatility level.
- A fall from near the ceiling to a low reading marks a change in how returns are distributed; the absolute level on its own depends on the bin count you chose.
- Pair it with a scale measure such as ATR % when you need to know whether that distribution is spread over large or small moves.
Parameters and defaults
Bins defaults to 8 and accepts 2 to 64, which puts the ceiling at the base-2 logarithm of the count — 3 bits by default. More bins make the estimate finer but noisier, since each bin then holds fewer samples. Window defaults to 50 returns and accepts 2 to 1000; keep it comfortably larger than the bin count, otherwise most bins remain empty and the result is dominated by sampling noise rather than by market behaviour.
| Parameter | Type | Default | Range |
|---|---|---|---|
| Bins | number | 8 | 2 – 64 |
| Window | number | 50 | 2 – 1000 |
What it does not show
Entropy is scale-free by construction, so it cannot say whether moves are large or small — that information is removed when the bins are fitted to the window's range. It ignores the order of the returns completely: a shuffled window gives the same value, which means a trend and a chop made of the same return sizes can read alike. The estimate depends on the ratio of samples to bins, so a 50/8 configuration cannot be compared with a 200/32 one. And a constant window produces nothing at all, which shows as a hole in the pane rather than as a zero.
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
- True Range — Volatility
- Std Dev — Volatility
- Squeeze — Volatility
- Chaikin Volatility — Volatility
- Realized Vol — Volatility
- Skewness — Volatility
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 Shannon entropy measure on a price chart?
- It measures how evenly recent returns are distributed across a set of equal-width buckets fitted to the window's own range. A high value means returns of many different sizes occurred; a low value means most bars produced a similar return. It describes the shape of the return distribution, not its magnitude and not its direction.
- What is the maximum value of the entropy indicator?
- The base-2 logarithm of the number of bins. With the default of 8 bins the maximum is 3 bits, reached only when every bin holds the same number of returns. Raising the bin count raises the ceiling — 16 bins give 4 bits — so readings taken at different bin counts are not directly comparable.
- How many bins should the entropy indicator use?
- The default is 8 bins over a 50-return window, which leaves an average of a few samples per bin. Increasing the bin count sharpens the resolution but spreads the same returns more thinly, so the estimate becomes noisier. Keep the window comfortably larger than the bin count, and compare readings only between charts using identical settings.