Skip to content
All library documents

Probability Distributions and Their Functions in MQL5

Article MQL5 articles

Summary

This article introduces probability distributions as models for random variables and outlines distinctions such as discrete versus continuous distributions, symmetry, location, and modality. It describes common ways to represent a distribution, including its density, cumulative distribution, inverse cumulative distribution, and survival function, with an emphasis on how these tools can help compare empirical market data with theoretical behavior.

The practical material presents MQL5 class implementations for distribution calculations, starting with the normal distribution. The normal class provides density, cumulative probability, quantiles, and survival probability, using error-function approximations for the calculations. The broader code collection is intended to cover multiple theoretical distributions and includes scripts for producing continuous and discrete distribution displays. The article offers a programming and statistical foundation rather than a trading strategy or empirical market study. It notes that parameterizations and formulas can differ across references, and it characterizes normality as uncommon in financial markets, making comparison with observed data more useful than assuming returns are normal.

Key ideas

  • A probability distribution describes the behavior of a set of observations for a random variable.
  • Distributions can be classified by whether their variables are discrete or continuous, among other properties.
  • Density, cumulative, inverse cumulative, and survival functions provide different views of a distribution.
  • The MQL5 examples implement normal-distribution probabilities and quantiles using error-function approximations.
  • The normal distribution is presented as a useful benchmark for empirical financial data, not a default model of market returns.

Tags

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