Price Frequency Histograms, Entropy, and Chi-Square Analysis
Summary
The document describes an MQL5 tool for analyzing the distribution of recent closing prices. It divides the observed price range into equal-width bins, counts observations in each bin, and calculates relative frequencies. It also outlines Shannon entropy as a measure of how evenly counts are spread and a chi-square goodness-of-fit statistic to compare observed frequencies with a uniform distribution. The tool displays results in a visual panel and supports per-bar or per-tick updates, alongside logging and additional descriptive statistics.
The article suggests interpreting dense bins as possible value areas, lower entropy as a sign of greater concentration, and chi-square values as evidence against uniformity. It proposes exploring mean reversion near dense bins and monitoring changes in entropy for possible regime shifts. These are hypotheses, not demonstrated trading results: the document provides no reported out-of-sample tests or evidence that the statistics predict profitable trades. Price observations are also time-dependent, so conventional distribution tests and histogram readings may not by themselves establish market structure or tradable significance.
Key ideas
- Equal-width price bins summarize where closing prices occur within a chosen analysis window.
- Shannon entropy describes how evenly observations are distributed across the bins.
- A chi-square statistic compares observed bin counts with counts expected under a uniform distribution.
- Dense bins and changing entropy are proposed as clues for further strategy research.
- The tool's statistical displays do not by themselves demonstrate predictive power or profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.