Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Prop Firm Equity Guard - expert for MetaTrader 5

Blessing Samuel Olasunkanmi
Blessing Samuel Olasunkanmi
Forex trader, MQL5 developer and founder of OlaDigital Nexus Framework, a registered Nigerian business focused on programming, trading and e-learning.
Views:
44
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Most prop firm challenges are not failed by a bad strategy. They are failed by breaking the daily loss rule by a few dollars - one trade left open too long, a spread spike at rollover, or one more "revenge" trade. Prop Firm Equity Guard watches your equity 4 times per second and closes everything before the limit is reached.

The EA does not open trades. It works next to your manual trading or any other Expert Advisor on the same account.

LIMITS (all based on equity, including floating profit and loss)
- Daily loss limit in % - base is the balance at the daily reset, or the higher of balance and equity (choose the rule of your firm)
- Maximum loss limit in % - static (from the initial account size) or trailing (from the highest equity, stopping at the initial size)
- Profit target in % - optional: close all and lock when the target is reached, so you do not give it back
- Safety buffer - acts a little before the real limit (default 0.5%) to allow for slippage and spread

WHAT HAPPENS AT A LIMIT
- All positions are closed and all pending orders are deleted
- The account is locked: any new trade opened while locked is closed at once (can be switched off)
- Daily lock is released automatically at the next daily reset; maximum loss and target locks stay until you clear them
- Locks and statistics are saved in terminal global variables, so they survive a terminal restart or VPS reboot
- If closing fails (for example, the market is closed), the EA keeps retrying and shows the reason on the panel

ALERTS
- Popup and push notification at 50% and 80% of the daily limit used (adjustable), and when a lock is triggered

PANEL
- Status: active or locked (with the reason)
- Equity and balance
- Daily loss used, maximum loss used and profit target progress, each with an amount, a percentage and a colour bar (teal, amber from 50%, red from 80%)
- Daily floor and maximum floor equity levels
- Time to the next daily reset

Inputs:
- Account rules: initial account size (0 = balance when first attached), daily loss %, daily loss base, maximum loss %, maximum loss mode (static / trailing), profit target %, safety buffer %
- Daily reset: hour and minute in server time (set this to your firm's reset time)
- Actions: all trades or one magic number, close new trades while locked, lock on target, clear saved locks on start
- Alerts: popup, push, first and second warning levels
- Panel: show, X and Y position

How to use:
1. Attach the EA to any one chart of the account (only one copy per account).
2. Enter the rules of your firm: account size, daily %, maximum %, target %, and the daily reset time.
3. Enable Algo Trading. The panel shows the floors - check that they match your firm's dashboard.
4. Keep the terminal running (a VPS is recommended): the guard can only act while the terminal is online.

Notes:
- Every firm calculates limits a little differently. Always compare the floors on the panel with your firm's rules and keep a safety buffer.
- The guard reduces risk but cannot prevent gaps or slippage beyond the limit, and it cannot act while the terminal is offline.
- To start a new challenge on the same account number, set "Clear saved locks and statistics on start" = true once, then back to false.

Tested on demo accounts (hedging and netting) in MetaTrader 5, with manual trades and with other Expert Advisors on the same account.
Demetra Symbol Spec Sheet Demetra Symbol Spec Sheet

Puts the contract specification of the chart symbol on one sheet, including the money value of one point and the margin for one lot.

Structural Swing Migration BUY Structural Swing Migration BUY

Structural Swing Migration BUY is an educational Expert Advisor for MetaTrader 5 that opens BUY positions when confirmed swing highs and swing lows move upward together. It evaluates closed M15 candles and combines structural confirmation with a volatility threshold and a bullish candle filter.

InputRules: Rules Between Inputs and the Share of Passes They Reject InputRules: Rules Between Inputs and the Share of Passes They Reject

A library for MetaTrader 5 that declares rules between the inputs of an Expert Advisor once in the code. OnInit rejects a combination that breaks a rule, with the reason in the Journal; before an optimization starts, OnTesterInit estimates which share of its passes the rules would reject and warns above a limit you set.

Channel Breakout EA with ATR trailing stop and risk-percent sizing Channel Breakout EA with ATR trailing stop and risk-percent sizing

Donchian channel breakout Expert Advisor with EMA trend filter, ATR stop, ATR trailing stop, break-even and position size from risk % of balance.