Discussing the article: "Extreme Value Theory in MQL5: Building a Tail-Risk Crash Gauge Beyond Monte Carlo VaR"

 

Check out the new article: Extreme Value Theory in MQL5: Building a Tail-Risk Crash Gauge Beyond Monte Carlo VaR.

Standard MQL5 risk tools read risk from recent history and miss how heavy the downside tail can be. We implement Extreme Value Theory in MetaTrader 5: a Peaks‑Over‑Threshold fit of the Generalized Pareto Distribution via ALGLIB, a live indicator that reports EVT VaR/ES and tail shape, and an EA that sizes positions from the tail estimate. A controlled backtest illustrates reduced drawdown for unchanged entries.

Start with the picture every risk model implicitly draws. If daily returns were normally distributed, then the probability of a move larger than three standard deviations would be about one in 740, and a move beyond five standard deviations would be a once-in-a-few-million-days event, something you would never expect to witness in a trading lifetime. Under that assumption, a stop placed a few standard deviations away is, for all practical purposes, safe.

Real financial returns break this story in two ways at once. They are more peaked in the center, with more days of near-zero returns than the normal curve allows, and they are fatter in the tails, with far more large moves. The five-sigma event that should never happen shows up every few years. The two distributions can have the same mean and the same standard deviation and still disagree violently about exactly the thing risk management cares about: the size of the rare loss.

Normal distribution overlaid on a fat-tailed return histogram, tail gap shaded

Author: Muhammad Minhas Qamar