Skip to content
All library documents

Building a Binned Empirical Distribution for Financial Data Exploration

Article TradingView scripts

Summary

This indicator explores the distribution of an input series by dividing its observed range into bins, counting the observations in each bin, and expressing those counts as shares of the sample. The resulting histogram approximates probability mass and is intended for data analysis rather than trade signals. Users can transform the input, including with logarithms, percentage changes, differencing, absolute values, or powers, and can trim observations considered corrupted or irrelevant.

The histogram can be compared with theoretical distributions, including normal, uniform, and Laplace distributions, and the tool exposes summary statistics and quantiles. It also offers lookback and date-range selection, custom bin sizing, and highlighting for the bin containing the current observation. These options support exploratory checks such as inspecting model residuals for departures from a reference distribution. Results depend on the sample, transformation, trimming choices, and bin width; a histogram is an approximation and does not establish a trading edge or prove a distributional model.

Key ideas

  • The indicator estimates an empirical distribution by binning observations across the selected data range.
  • Counts are expressed as a fraction of the sample, giving an approximate probability mass for each bin.
  • Transformations and trimming let users examine different representations or exclude selected observations.
  • The empirical histogram can be compared with normal, uniform, and Laplace reference distributions.
  • The tool is for exploration, and its results depend on the sample and binning choices rather than generating trading signals.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.