Total Risk If All Stops Hit
A trader with multiple positions across several symbols is taking a portfolio risk, not just individual trade risk. The worst-case scenario — the one that matters for position sizing — is all stops triggering together, either because of a market shock or a correlation event that usually keeps them separate. Most traders who track position risk do so trade by trade. What they do not do is sum the absolute worst case across the entire portfolio, which is where real damage happens. This script walks every open position, reads its stop loss, calculates how much money would be lost if that stop executed right now, then sums all the losses together. It expresses the total both as a currency amount and as a percentage of current account equity, so you know exactly what the worst-case equity drop is if everything goes wrong at once. A portfolio taking more than 5% of equity as worst-case risk is aggressive and should only happen when the trader knows they can accept an equity drop of that magnitude. A 20% worst-case risk is extremely high. Notes and limitations - Positions without a stop loss are counted but not included in the risk total. The script flags how many positions are unprotected. - Risk is calculated from tick value and tick size, not a hardcoded contract size. It does not include commission or swap because those figures change constantly. - The calculation is a pure price-based worst case. Real execution slippage, particularly on illiquid symbols or at news events, can be worse. - On a netting account, only one position per symbol can exist, so the worst case is all of those positions hitting at once. - This script does not modify stops or positions. It reports only.
Script · MT4 · v1.0 · Free
About Total Risk If All Stops Hit
Total Risk If All Stops Hit is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. MQL source code included.
Files in the download: TotalRiskIfAllStopsHit.ex4, TotalRiskIfAllStopsHit.mq4, TotalRiskIfAllStopsHit.txt.
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Risk & Lot Size · Alerts · MT4 Script · MQL4 Source Code