Margin Level Protector MT5
- 유틸리티
- 버전: 1.0
Protect your account from a Stop Out. The EA warns you when the margin level gets low, then closes positions one by one, biggest loser first, until the margin level is safe again. Free, one chart, works with manual trades and with any Expert Advisor.
When the margin level falls to the broker's Stop Out level, the broker closes your positions for you, at the worst moment and in its own order. Margin Level Protector acts earlier, at a level you choose, and closes only as much as needed.
HOW IT WORKS
- You attach the EA to any one chart and set two levels: a warning level (for example 300 %) and a close level (for example 150 %).
- Every second, it reads the account margin level: equity / used margin x 100.
- SAFE - above the warning level, nothing happens.
- WARNING - below the warning level, you get one alert. It is shown again only after the margin level has recovered.
- PROTECTING - below the close level, it closes one position per second (biggest loser first by default). After each close the margin level goes up, and it stops as soon as the level is back above your close level.
FEATURES
- Warning level and close level in % (0 = off)
- Close order: biggest loser first, largest volume first, or all positions at once
- Delete pending orders when it starts closing (optional)
- Which trades it may close: all trades, manual trades only, or one EA by magic number
- Pop-up alert and optional push notification to the MetaTrader 5 mobile app, without a flood of pop-ups
- On-chart panel with status, margin level, your levels, the broker's stop out and how many positions it closed today
- If your close level is not above the broker's stop out, the panel tells you to raise it
THE PANEL ON THE CHART
- Status: SAFE / WARNING / PROTECTING - the current state.
- Margin level - the current margin level, or "no open positions" when no margin is used.
- Warning / Close - your two levels.
- Broker stop out - the level where the broker closes positions itself. Your close level must be above it.
- Closed by protector today - positions closed by the EA today.
WHO IT IS FOR
- Traders who use high leverage, grids or many positions at the same time
- Traders who run Expert Advisors and want a safety net for the whole account
- Anyone who wants to decide which trades are closed first, instead of the broker
SETUP
- Drag Margin Level Protector MT5 onto any one chart (any symbol, any timeframe).
- In the Common tab, tick "Allow Algo Trading". Make sure the Algo Trading button on the toolbar is on, otherwise the EA cannot close positions.
- In the Inputs tab, set your levels and press OK. The panel appears on the chart.
INPUTS
- Warning when margin level is below (%): one alert below this level (0 = off)
- Close positions when margin level is below (%): start closing below this level (0 = off)
- Which positions to close first: biggest loser first, largest volume first, or all at once
- Also delete pending orders when closing
- Close which trades: -1 = all trades, 0 = manual trades only, any other value = only the EA with this magic number
- Pop-up alert / Push notification to the MT5 mobile app
- Show panel on chart / Panel corner / Panel X and Y offset
NOTES
- One chart is enough for the whole account. Attach it only once.
- Set the warning level higher than the close level, and the close level higher than the broker's stop out (shown on the panel).
- The EA works only while MetaTrader 5 is running and connected. For full protection, run it on a VPS.
- Push notifications need your MetaQuotes ID in Tools > Options > Notifications.
- The EA does not open trades. It only closes positions (and pending orders, if enabled) when the margin level is below your close level.
- Also free from the same author: Daily Loss Limit Lock MT5 and Max Trades Per Day MT5.
Questions or suggestions? Send me a private message on MQL5. If the EA helps you, a short review is very much appreciated.
