MetaTrader 5 Help → MCP and AI → Examples → Risk Management Operations

Risk Management Operations Using AI with MetaTrader

Adapt the symbols, periods, position sizes, risk limits, and any criteria to your approach or preferences. Carefully study every prompt before using it and review any proposed action before executing it.
 
You are solely responsible for AI-generated content, AI-assisted actions, trading decisions, trading results, and any resulting losses.

Portfolio risk audit:

Audit my open positions for correlated, duplicated, and concentrated exposure using daily returns from the last 60 trading days. Identify the single market move that would cause the greatest portfolio loss.

Portfolio stress test:

Stress-test my open positions using a 20% volatility increase, 50% spread increase, and correlations from the last 60 trading days. Show the worst scenario and largest contributors.

Weak-position reversal:

Review all open positions on H1 using MACD, RSI, and the last 10 trading days. Close positions with confirmed reversals, then open one 0.2-lot opposite position for the two strongest reversal signals.

Portfolio failure modes:

Using open positions, pending orders, margin use, and daily returns from the last 60 trading days, identify the three scenarios most likely to cause a simultaneous portfolio loss. Estimate the largest contributors and suggest the smallest practical risk reductions.

Stop-loss audit:

Review each open position against its entry, current price, stop loss, take profit, H1/H4 structure, and volatility over the last 20 trading days. Flag stops that are too tight, too wide, inside nearby noise, or no longer aligned with the trade thesis.

Margin stress test:

Use my account balance, equity, leverage, margin, open positions, and pending orders to model 2%, 5%, and 10% adverse moves in correlated symbols. Show the free-margin impact and the first three positions to reduce.

Correlation shock:

Calculate rolling correlations for my open-position symbols over the last 60 trading days. Identify pairs whose correlation has risen sharply and the exposure that is not truly diversified.

Hidden concentration:

Using daily returns from the last 60 trading days, group my open positions by shared price behavior. Identify the largest hidden concentration and the positions that genuinely diversify it.

Weekend gap risk:

For positions open before the weekend, review daily gaps from the last 6 months, current volatility, recent news, and stop distance. Rank positions by gap risk.

Risk budget:

Calculate the current monetary risk of every open position from entry, current stop, volume, and account equity. Group it by symbol, direction, and correlation cluster, then identify exposures that exceed my portfolio risk budget.

Extreme-value expected shortfall:

For positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591, use the latest 500 D1 symbol returns and fit one generalized Pareto model to portfolio losses above the 90th percentile. Estimate 97.5% expected shortfall, compare it with ordinary historical simulation, and identify one position reduction if either estimate exceeds 4% of equity.

Conditional drawdown-at-risk:

For positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591, reconstruct the portfolio underwater curve from the latest 250 D1 bars and estimate the mean of its worst 10% drawdowns with 100 five-day block-bootstrap samples. Calculate marginal conditional drawdown-at-risk by removing each position in turn and identify the most effective reduction.

Tail-copula exposure:

For positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591, fit one Student-t copula to the latest 250 D1 returns and compare pairwise lower-tail dependence with linear correlation. Identify the two pairs with the largest hidden joint-loss risk and propose one targeted reduction.

Hierarchical Risk Parity repair:

Use positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591 together with saved MSFT and NVDA holdings and their latest 250 D1 returns to build one hierarchical clustering tree. Compare current weights with Hierarchical Risk Parity weights, identify the most concentrated branch, and give a two-step rebalance that respects tradable volume increments.

Risk-network centrality:

For EURUSD, GBPUSD, USDJPY, XAUUSD, US500, AAPL, MSFT, and NVDA exposures, create a network from their latest 120 D1 returns using downside correlation above 0.5 and one-day lead-lag correlation above 0.3 as edges. Rank nodes by degree and betweenness centrality and identify the single position with the greatest potential to transmit loss.

First-passage margin risk:

For open positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591, simulate 200 correlated H1 price paths of 24 steps using the latest 60 trading days. Estimate the probability that free margin crosses 150% before any stop or target, report the median first-passage time, and test reducing each position separately.

Estimation-aware fractional Kelly:

For LondonBreakout_v4 trades with magic number 41027, GoldMeanReverter trades with magic number 52014, and IndexTrend_v2 trades with magic number 63008, use the latest 60 trades in each group to estimate the Kelly fraction and shrink it by one standard error. Compare full, half, and quarter Kelly using 100 bootstrap trade sequences and state the largest fraction compatible with a 10% drawdown limit.

Stop-loss value test:

For LondonBreakout_v4 trades with magic number 41027, use the latest 30 stop-loss exits and M15 data from entry until 12 hours after exit to compare each actual stop with an unstopped counterfactual. Group results only by positive or negative pre-entry return persistence and state whether the stop added value in either group.

Quote-drought survival horizon:

For XAUUSD position #73124552, US500 position #73124576, and USDJPY position #73124537, use the latest 5,000 ticks per symbol to measure no-quote intervals and spread recovery after the five longest gaps. Compare the worst observed recovery with each position's margin buffer and flag any position that could not tolerate a repeat.

Shapley tail-loss attribution:

For open positions #73124501, #73124518, #73124537, #73124552, #73124576, and #73124591, use the 50 worst historical portfolio days plus 100 correlated simulated shocks to calculate exact Shapley contributions to loss. Compare them with standalone loss and identify the smallest position set responsible for more than half of interaction-driven risk.