You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Entropy Pooling and Scenario Budgets for Expected-Shortfall Sizing.
Every risk number an Expert Advisor computes from history rests on an unstated choice: which past bars count, and by how much. A 250-bar volatility or historical VaR gives the last 250 bars equal weight and everything older exactly zero. That is a probability vector over the history, chosen by the length of an array rather than by anyone deciding it.
The choice has measurable costs. Later in this article an Expert Advisor holds a five-pair currency basket at a daily expected-shortfall budget of 1% of equity. Sized by a 250-bar window, it entered March 2020 at 1.70 times equity in gross notional, because the window still described the calm of 2019, and on 10 March the book lost 2.85% in a day. The window also cannot take in information the history lacks, such as an expected rise in USDJPY volatility before a central bank meeting.
Entropy pooling, introduced by Attilio Meucci in Fully Flexible Views: Theory and Practice, addresses both problems. Keep every historical scenario as it happened and change only the probability attached to each, choosing the new probabilities as close as possible to a prior, in relative entropy, subject to whatever you want to be true: that today's volatility regime applies, that USDJPY volatility is 50% higher, that a Swiss franc shock has at least a 1% chance. The entropy here is the relative entropy between two probability vectors over the same scenarios, used as a distance, not the randomness of a price series.
We build the method in pure MQL5: a five-file library, a demonstration script, a set of checks against closed-form results, a walk-forward test of the forecasts, an indicator that draws the conditioned risk on a chart, and the sizing Expert Advisor.
Author: Muhammad Minhas Qamar