ExposureGuard Correlated Risk Monitor
- Utilities
-
Ibrahim Maher Mohamed Soliman
Software engineer specialized in MT5/MQL5 automation: expert advisors, custom indicators, Pine Script to MQL5 conversion, and risk-management tools. Clean code, honest backtests, full documentation. - Version: 1.0
- Activations: 5
ExposureGuard is a read-only risk monitor. It opens no trades of its own.
MetaTrader shows every position on its own line. Three trades risking 1% each look like 1% + 1% + 1%. But if those three symbols move together, they are not three trades. They are one trade in three tickets, and the account finds out when a single candle takes all three stops.
That risk never appears on any single trade's risk-reward. It only exists at the portfolio level, and MetaTrader has no portfolio level. ExposureGuard adds one.
WHAT THE PANEL TELLS YOU
- Worst case if every stop is hit: every position's risk-to-stop, converted to your account currency and summed. One number, and usually larger than expected.
- Biggest moving-together cluster: ExposureGuard measures the correlation between your open symbols, signs it by each position's direction, and groups the ones that lose together. You get the size of that group and what it costs if it goes wrong.
- Hidden risk factor: your correlated risk divided by the risk the same book would carry if the positions really were independent. 1.00x means genuinely diversified. 1.70x means you are carrying 70% more risk than the number of trades suggests.
- Net currency exposure: every position split into its base and quote legs and netted per currency, in your account currency, with leverage against equity. Long EURUSD, long GBPUSD and short USDCHF stop looking like three ideas and start looking like one large short-dollar position, which is what they are.
- Daily allowance context: enter the daily loss limit you trade to and open risk is shown as a percentage of it, with a progress bar. Built for traders on funded and evaluation accounts.
- Leverage, margin and floating P/L, so position size has context.
- Alerts: popup and push on worst case, cluster risk, hidden risk factor, single-currency leverage, positions left without a stop-loss, and 80% of your daily allowance. Every threshold is an input; every alert has a cooldown so it warns you without nagging.
- LOG FULL REPORT button: prints every position, every exposure bucket and the entire correlation matrix to the journal, ready to paste into a trading journal.
HOW THE NUMBERS ARE BUILT, SO YOU CAN JUDGE THEM
Risk-to-stop is priced with OrderCalcProfit(), which uses your broker's own conversion, so cross-currency accounts, metals and CFDs are handled without any hard-coded exchange-rate table. Correlation is Pearson on log returns, computed only on bars whose times actually match between two symbols, over a lookback you choose (default H1, 240 bars). Joint risk is standard portfolio variance with each correlation signed by the two positions' directions, so a real hedge reduces the number instead of inflating it.
SETUP IN ONE MINUTE
Drag it onto any one chart. Symbol and timeframe are irrelevant, it monitors the account, not the chart. Set your daily loss allowance. Done.
HONEST LIMITATIONS, SO YOU KNOW EXACTLY WHAT YOU ARE BUYING
- Correlation is measured from past closing prices. It is an estimate, not a forecast, and correlations move towards 1.0 in a crisis, precisely when the number matters most.
- "Worst case" assumes every stop-loss fills at its price. Gaps and slippage can make the real loss larger. It is a floor on the bad outcome, not a ceiling.
- Positions without a stop-loss have no bounded risk. By default they are excluded from the totals and flagged loudly, because any figure put there would be invented. Two other modes let you choose your own assumption knowingly.
- Symbols with no price history or tick data at your broker cannot be valued. Those pairs are reported as unmeasured rather than guessed, and the panel shows how many pairs were actually measured.
- Limits: 64 positions, 24 distinct symbols, 500 correlation bars.
- It measures. It does not size your trades, and it cannot prevent a loss.
This is a risk-measurement utility, not financial advice, and it makes no profit promises. Please test it on a demo account first.
Works with PropGuard. PropGuard stops you breaching your daily limit. ExposureGuard tells you why you were about to. They read the same daily allowance and can run on the same chart.
