Daily PL risk management
- Utilità
- Minh Vuong Pham
- Versione: 1.0
Automated Daily Loss/Profit Limiter & Max Drawdown Protection Essential for Prop Firm Challenges (FTMO, MFF, TFT, etc.)
What Is It?
Daily P/L Limiter automatically monitors your account's daily Profit & Loss and takes action when your limits are hit. It tracks both realized (closed trades) and unrealized (open positions) P/L, and can close all positions, disable trading, or send alerts.
This is a must-have safety net for prop firm traders, where a single bad day can fail an entire challenge.
3 Protection Layers
1. Daily Loss Limit
Close all positions when today's total loss exceeds your limit.
- Set in USD ($100) or % of day-start balance (2%)
- Includes realized + unrealized P/L
- Actions: Close All, Close All + Disable Trading, or Alert Only
2. Daily Profit Target
Lock in profits by closing everything when your daily target is reached.
- Prevents giving back gains from overtrading
- Set in USD ($200) or % of balance (3%)
3. Max Drawdown (Overall)
Ultimate safety net — monitors total account drawdown from initial balance.
- Set as % of initial balance (e.g., 10%)
- Critical for prop firms with max DD rules (typically 8-12%)
- Triggers even if daily limit hasn't been hit
Key Features
- Tracks Realized + Unrealized P/L — includes already-closed trades today + open positions
- Includes Swap & Commission — accurate P/L for real trading conditions
- Two scopes: Current Symbol Only or Entire Account (all symbols)
- Auto daily reset at configurable server hour (default: midnight)
- Weekend Protection — auto-close before market close Friday
- Warning system — yellow alert at 80% of limit (configurable)
- Notifications: Popup Alert, Push Notification, Sound Alert
- Today's High/Low P/L tracking — see how close you got to limits
- Real-time chart display — shows daily P/L, limits, usage %, DD
Prop Firm Configuration Examples
FTMO Challenge
- Daily Loss Limit: 5% of initial balance
- Max Drawdown: 10% of initial balance
- Profit Target: OFF (manage manually)
- Action: Close All + Disable Trading
- Scope: Entire Account
My Forex Funds / The Funded Trader
- Daily Loss Limit: 5% (or $500 for $10k account)
- Max Drawdown: 8-12% depending on plan
- Weekend Protection: ON (Friday 23:30)
- Scope: Entire Account
Conservative Personal Trading
- Daily Loss Limit: $50-100 or 1-2%
- Daily Profit Target: $100-200 or 2-3%
- Max Drawdown: OFF (use daily limit instead)
- Scope: Account or per-symbol
Input Parameters
Daily Loss Limit
| Parameter | Description |
|---|---|
| EnableLossLimit | Enable/disable daily loss limit |
| LossLimitMode | USD Amount or % of Balance |
| DailyLossLimitUSD | Loss limit in dollars (default: $100) |
| DailyLossLimitPercent | Loss limit as % (default: 2%) |
Daily Profit Target
| Parameter | Description |
|---|---|
| EnableProfitTarget | Enable/disable profit target |
| ProfitTargetMode | USD Amount or % of Balance |
| DailyProfitTargetUSD | Target in dollars (default: $200) |
| DailyProfitTargetPercent | Target as % (default: 3%) |
Max Drawdown
| Parameter | Description |
|---|---|
| EnableMaxDD | Enable/disable max DD protection |
| MaxDrawdownPercent | Max DD % from initial balance (default: 10%) |
| InitialBalance | Reference balance (0 = use current) |
Behavior
| Parameter | Description |
|---|---|
| Scope | Current Symbol or Entire Account |
| ActionOnLoss | Close All / Close+Disable / Alert Only |
| ActionOnProfit | Close All / Close+Disable / Alert Only |
| ActionOnMaxDD | Close All / Close+Disable / Alert Only |
| IncludeSwapCommission | Count swap & commission in P/L |
| CountClosedTrades | Include today's closed trades |
Timing
| Parameter | Description |
|---|---|
| DailyResetHour | Reset hour, server time (default: 0 = midnight) |
| WeekendProtection | Auto-close Friday before market close |
| WeekendCloseHour | Friday close hour (default: 23) |
| WeekendCloseMinute | Friday close minute (default: 30) |
Notifications
| Parameter | Description |
|---|---|
| EnableAlerts | Popup alert on trigger |
| EnablePushNotification | Mobile push on trigger |
| EnableSoundAlert | Play sound on trigger |
| WarningPercent | Show warning at X% of limit (default: 80%) |
Chart Display
The on-chart panel shows:
- Scope (Account/Symbol) and open position count
- Day Start Balance
- Realized P/L (closed trades today)
- Unrealized P/L (open positions)
- Total Daily P/L
- Today's High/Low P/L
- Loss Limit with % used bar
- Profit Target with % reached bar
- Max DD current vs limit
- Weekend close countdown (Friday)
Installation
- Copy DailyPL_Limiter_v1.mq5 → MQL5/Experts/
- Restart MT5 → drag onto any chart
- Configure inputs for your prop firm rules
- Enable AutoTrading
- Important: Set Scope = Entire Account for prop firm usage
Complete Trading Toolkit
| Tool | Role |
|---|---|
| OneClick Trade Panel | Fast entry + risk calculator |
| Collective TP Manager | Collective profit target for groups |
| Trailing Stop Manager | Auto-protect profits |
| Daily P/L Limiter | Daily risk control + prop firm safety |
These 4 tools cover the full trading lifecycle: Entry → Management → Protection → Risk Control.
This EA is a risk management tool. It does not guarantee passing prop firm challenges. Always test on demo first. Trading involves substantial risk of loss.
