Skip to Content
ChartIndicatorsPermutationEntropy

PermutationEntropy

PermutationEntropy (PE, Bandt and Pompe’s permutation entropy) shows how ordered the price movement is: it looks at which of the neighboring bars is higher than which and measures how varied these patterns are. The value lies from 0 — the movement is ordered (a trend, a cascade) — to 1 — all patterns are equally frequent (noise).

The indicator is drawn in a separate area below the chart.

How to read it

  • Falling entropy means the movement is becoming ordered: the start of a trend or a liquidation cascade.
  • Rising entropy means the noise is coming back.

How it is calculated

  1. For each bar a pattern is taken — the order of the prices set in Source over the last Pattern length bars (which bar is higher than which). With a length of 3 there are 6 possible patterns, with 4 — 24, with 5 — 120.
  2. Over the last Window patterns, the frequency of each of them is counted.
  3. The entropy of these frequencies is divided by the largest possible one, so the value lies from 0 to 1.

The first value appears on bar number “pattern length + window − 1” — the 123rd with the default settings.

Equal prices count as a rise, so a standing price lowers the entropy: on symbols with rare trades Typical is more accurate. With a pattern length of 5, a window of 120 is too small — it needs 600 bars or more.

Parameters

ParameterDescriptionDefault
Pattern lengthHow many neighboring bars are in a pattern: 3 — 6 patterns, 4 — 24, 5 — 120. From 3 to 5.4
WindowHow many last patterns the entropy is calculated over; it should be at least 5 times the number of patterns. At least 10.120
SourceThe bar price used in the calculation: Close — the close, Median — (High + Low) / 2, Typical — (High + Low + Close) / 3.Close

Plots

ParameterDescriptionDefault
EntropyThe entropy from 0 to 1.Orange, solid, width 1

Style

The Entropy line has the Plot (show the line), Label (show the last value on the right scale), Color, Width (1–5) and Style (Solid, Dashes, Dots) fields.

How to add an indicator to the chart is described in Adding an indicator; parameters are changed in the indicator manager.

Last updated on