Weekly High Watermark Equity Guardian – Prop Firm Risk Manager (MT5)

MQL5 Esperti

Lavoro terminato

Tempo di esecuzione 5 giorni
Feedback del dipendente
Outstanding client! Skyler provided a clear specification and communicated perfectly. Very professional, understanding, and a true pleasure to work with. Highly recommended! 5 stars.

Specifiche

I am looking for a professional developer to create a specialized Risk Management Expert Advisor (EA) for MetaTrader 5. This EA is designed to enforce Weekly High Watermark and Weekly Drawdown rules for a prop firm challenge.

CRITICAL REQUIREMENT: The EA must allow me to define the exact day and time the weekly cycle resets via input variables.
1. Core Logic: Weekly Cycle & Reset

The EA must monitor the broker server time and trigger a "New Week Reset" at a user-defined moment.

Input Variables:

    WeekStartDay: (Dropdown/Enum) Sunday through Saturday (0=Sunday, 1=Monday, etc.)
    WeekStartHour: (0–23) Broker server hour
    WeekStartMinute: (0–59) Broker server minute

Reset Actions: At the specified time each week, the EA must:

    Capture and store WeekStartEquity = AccountEquity()
    Initialize WeeklyHighWatermark = AccountEquity()
    Reset all drawdown counters and violation flags
    Unblock trading (if UnblockOnNewWeek is set to true)
    Log to Experts Journal: "Weekly cycle reset at [timestamp]"

Persistence: The EA must use GlobalVariables or a local file to store the WeeklyHighWatermark and WeekStartEquity so that the data is not lost if the terminal or VPS restarts.

Important: The reset must happen once per week only, not every time that day/hour occurs. Use a timestamp check to prevent duplicate resets.
2. High Watermark & Drawdown Tracking

On every tick, the EA must perform the following calculations:

    High Watermark Update: If AccountEquity() > WeeklyHighWatermark, update the watermark to the new peak.
    Drawdown from High (Floating):
    DD_FromHigh_% = (WeeklyHighWatermark - AccountEquity()) / WeeklyHighWatermark * 100
    Drawdown from Week Start:
    DD_FromStart_% = (WeekStartEquity - AccountEquity()) / WeekStartEquity * 100

3. Early Warning Alert

Input Variables:

    UseEarlyWarningAlert (bool): Enable/disable the early warning system
    EarlyWarningDD_Percent (double): e.g., 2.5%
    When drawdown from the weekly high watermark reaches this percentage, trigger an alert.

Behavior:

    When DD_FromHigh_% >= EarlyWarningDD_Percent:
        Send a Push Notification to mobile (if enabled)
        Write to Experts Journal: "WARNING: Drawdown from weekly high has reached [X]%. Current equity: [Y]"
        Do NOT stop trading or close any positions
        Alert should trigger only once per threshold breach (use a flag to prevent spam)
        Reset the alert flag when equity recovers above the threshold or when the weekly cycle resets

Example:

    WeeklyHighWatermark = \$10,000
    EarlyWarningDD_Percent = 2.5
    When equity drops to \$9,750 → Alert fires
    Trading continues normally
    If equity recovers to \$9,800, the alert is re-armed and can fire again if it drops back

4. Risk Rules & Protection (Hard Limits)

Parameters:

    UseMaxWeeklyDD_FromHigh (bool): Enable/disable this limit
    MaxWeeklyDD_FromHigh_Percent (double): e.g., 4.0%
    Trigger protection if equity drops this far from the weekly peak
    UseMaxWeeklyDD_FromStart (bool): Enable/disable this limit
    MaxWeeklyDD_FromStart_Percent (double): e.g., 5.0%
    Trigger protection if equity drops this far from the week's starting equity

Actions on Violation:

    ActionOnLimitHit (Dropdown/Enum):
        0 = None (log only)
        1 = Close All Trades & Block Trading
        2 = Block New Trades Only (leave existing trades open)

    If "Close All Trades & Block" is selected:
        Close all open positions across the entire account (all symbols)
        Delete all pending orders
        Set trading block flag

    Trading Block Behavior:
        Once a hard limit is hit, the EA must prevent any further trading until:
            The next weekly reset occurs (if UnblockOnNewWeek = true), OR
            A manual reset is triggered

5. CONTINUOUS FAILSAFE (CRITICAL REQUIREMENT)

On EVERY tick while the trading block is active, the EA must:

    Cancel ALL pending orders on the account (all symbols, all magic numbers)
    Close ALL open positions on the account (all symbols, all magic numbers)
    Log to Experts Journal: "FAILSAFE ACTIVE: All trades closed, all pending orders deleted"

Purpose:
This is a complete failsafe to ensure that if any other EA, script, or manual action attempts to open trades or place orders while the block is active, they are immediately closed/cancelled on the very next tick.

Implementation Notes:

    This failsafe loop should run only when the block flag is active
    Use a loop to iterate through all open positions and pending orders
    Handle both Market and Pending orders
    Must work across all symbols on the account, not just the chart symbol
    Should be efficient (don't spam the trade server unnecessarily, but ensure protection)

Input Variable:

    EnableContinuousFailsafe (bool): Default = true
    Allows the user to disable this behavior if needed (though it's highly recommended to keep it enabled)

6. Integration with Other EAs

The EA should set a Global Variable to communicate trading status to other EAs:

    GlobalVariableSet("RiskGuardian_BlockTrading", 1) when blocked
    GlobalVariableSet("RiskGuardian_BlockTrading", 0) when allowed

Input Variables:

    UseGlobalBlockFlag (bool): Enable/disable this feature
    GlobalBlockFlagName (string): Default = "RiskGuardian_BlockTrading"

Include a comment in the code explaining how other EAs can check this flag before opening trades.
7. Visual Dashboard (On-Chart Panel)

A clean, non-intrusive UI panel displaying:

    Current Balance / Equity
    Week Start Equity
    Weekly High Watermark
    Drawdown % from High (color-coded: green < warning threshold, yellow >= warning, red >= hard limit)
    Drawdown % from Start
    Status: [TRADING ALLOWED] or [BLOCKED - LIMIT HIT: reason]
    Failsafe Status: [FAILSAFE ACTIVE] when continuous failsafe is running
    Next Weekly Reset: Displays configured Day/Time (e.g., "Monday 00:00")
    Time Until Reset: Countdown (e.g., "2d 14h 23m")

Panel Settings:

    ShowInfoPanel (bool)
    PanelCorner (enum): Top-Left, Top-Right, Bottom-Left, Bottom-Right
    FontSize (int)
    PanelColor / TextColor (color inputs)

8. Manual Reset

Input Variable:

    ManualReset (bool): When set to true, the EA should:
        Immediately reset WeekStartEquity = AccountEquity()
        Reset WeeklyHighWatermark = AccountEquity()
        Clear all violation and alert flags
        Unblock trading (disable failsafe)
        Log: "Manual reset executed at [timestamp]"
        Automatically set ManualReset back to false to prevent repeated resets

9. Alerts & Notifications

Input Variables:

    EnablePopupAlert (bool): Show popup dialog on screen
    EnablePushNotification (bool): Send to mobile app
    EnableEmailAlert (bool): Send email
    EnableSoundAlert (bool): Play sound file
    AlertSoundFile (string): e.g., "alert.wav"

Trigger alerts for:

    Early warning threshold reached
    Hard limit violation (trading blocked)
    Weekly cycle reset
    Failsafe activation (first time only, not on every tick)

Complete Input Parameters Summary

mql5
Copy
//--- Weekly Cycle Timing  
input int      WeekStartDay              = 1;        // Week Start Day (0=Sun,1=Mon,...,6=Sat)  
input int      WeekStartHour             = 0;        // Week Start Hour (0-23, broker time)  
input int      WeekStartMinute           = 0;        // Week Start Minute (0-59)  
input bool     UnblockOnNewWeek          = true;     // Auto-unblock trading on new week  
  
//--- Early Warning Alert  
input bool     UseEarlyWarningAlert      = true;     // Enable early warning alert  
input double   EarlyWarningDD_Percent    = 2.5;      // Alert threshold % from high watermark  
  
//--- Hard Limits (Protection)  
input bool     UseMaxWeeklyDD_FromHigh   = true;     // Enable max DD from high limit  
input double   MaxWeeklyDD_FromHigh_Percent = 4.0;   // Max drawdown % from weekly high  
input bool     UseMaxWeeklyDD_FromStart  = true;     // Enable max DD from start limit  
input double   MaxWeeklyDD_FromStart_Percent = 5.0;  // Max drawdown % from week start  
  
//--- Actions  
input int      ActionOnLimitHit          = 1;        // 0=None, 1=CloseAll&Block, 2=BlockOnly  
input bool     EnableContinuousFailsafe  = true;     // Close all trades/orders on every tick while blocked  
  
//--- Global Variable Integration  
input bool     UseGlobalBlockFlag        = true;     // Use global variable for other EAs  
input string   GlobalBlockFlagName       = "RiskGuardian_BlockTrading"; // Global variable name  
  
//--- Manual Controls  
input bool     ManualReset               = false;    // Trigger manual reset  
  
//--- Alerts & Notifications  
input bool     EnablePopupAlert          = true;     // Show popup alerts  
input bool     EnablePushNotification    = true;     // Send push notifications  
input bool     EnableEmailAlert          = false;    // Send email alerts  
input bool     EnableSoundAlert          = true;     // Play sound on alert  
input string   AlertSoundFile            = "alert.wav"; // Sound file name  
  
//--- Visual Panel  
input bool     ShowInfoPanel             = true;     // Display on-chart panel  
input int      PanelCorner               = 1;        // 0=TL, 1=TR, 2=BL, 3=BR  
input int      FontSize                  = 10;       // Panel font size  
input color    PanelColor                = clrDarkSlateGray; // Panel background  
input color    TextColor                 = clrWhite; // Panel text color  
  
//--- General  
input string   CommentText               = "RiskGuardian"; // EA comment  
input int      MagicNumber               = 999999;   // Magic number (for future use)  

Technical Requirements

    Platform: MetaTrader 5 only
    Account Type: Must work with both Hedging and Netting accounts
    No external DLLs
    No indicators required – pure equity/account monitoring
    Must work on any symbol / any timeframe (logic is account-level, not chart-level)
    Must handle:
        Platform restarts
        VPS restarts
        Network disconnections
    Use GlobalVariables and/or file storage to persist critical data across restarts
    Failsafe must be efficient: Don't spam the trade server, but ensure all trades/orders are closed immediately when block is active

Deliverables

    Source code: .mq5 file (well-commented)
    Compiled file: .ex5
    Short documentation (text or PDF):
        Explanation of each input parameter
        How the weekly reset logic works
        How the continuous failsafe works
        How other EAs can read the global block flag
        Example configuration for common prop firm rules (FTMO, MyForexFunds, etc.)
    Testing instructions:
        How to test in Strategy Tester with custom dates
        How to verify weekly reset behavior
        How to simulate drawdown scenarios and verify failsafe activation

Budget & Timeline

    Please provide your price quote and estimated delivery time
    I am looking for a clean, robust implementation with no unnecessary complexity
    If you have built similar prop firm risk managers or equity protection tools, please share examples or screenshots

Notes

    This EA is specifically for prop firm challenges / funded accounts
    Accuracy of drawdown calculations is critical
    No trading strategy logic needed – this is purely a risk management / equity monitoring tool
    The EA should be lightweight and efficient (minimal CPU usage)
    The continuous failsafe is a critical safety feature – it must work reliably to protect the account

Con risposta

1
Sviluppatore 1
Valutazioni
(28)
Progetti
39
23%
Arbitraggio
14
0% / 93%
In ritardo
4
10%
Gratuito
2
Sviluppatore 2
Valutazioni
(4)
Progetti
3
33%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
(538)
Progetti
814
62%
Arbitraggio
33
27% / 45%
In ritardo
23
3%
Gratuito
Pubblicati: 1 codice
4
Sviluppatore 4
Valutazioni
(3)
Progetti
1
100%
Arbitraggio
3
0% / 100%
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
Progetti
1
0%
Arbitraggio
1
0% / 0%
In ritardo
0
Gratuito
6
Sviluppatore 6
Valutazioni
(3)
Progetti
3
0%
Arbitraggio
0
In ritardo
0
Gratuito
7
Sviluppatore 7
Valutazioni
(64)
Progetti
83
28%
Arbitraggio
9
33% / 56%
In ritardo
9
11%
Gratuito
Pubblicati: 1 codice
8
Sviluppatore 8
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 1 articolo
9
Sviluppatore 9
Valutazioni
(2)
Progetti
2
50%
Arbitraggio
0
In ritardo
0
In elaborazione
10
Sviluppatore 10
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
12
Sviluppatore 12
Valutazioni
(3)
Progetti
6
17%
Arbitraggio
1
0% / 0%
In ritardo
1
17%
In elaborazione
13
Sviluppatore 13
Valutazioni
(1)
Progetti
0
0%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
14
Sviluppatore 14
Valutazioni
(5)
Progetti
5
60%
Arbitraggio
1
0% / 0%
In ritardo
2
40%
Gratuito
Pubblicati: 1 codice
15
Sviluppatore 15
Valutazioni
(16)
Progetti
35
23%
Arbitraggio
4
0% / 50%
In ritardo
2
6%
In elaborazione
16
Sviluppatore 16
Valutazioni
(271)
Progetti
553
50%
Arbitraggio
57
40% / 37%
In ritardo
227
41%
In elaborazione
17
Sviluppatore 17
Valutazioni
(151)
Progetti
211
69%
Arbitraggio
8
38% / 38%
In ritardo
22
10%
Gratuito
18
Sviluppatore 18
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
Title: MT5 EA Needed – Prop‑Firm Compliance Tool (SL/TP at Entry, 60‑Second Hold, Daily Profit Cap, 0.5% XAUUSD Risk) Description: I need an MT5 Expert Advisor that enforces prop‑firm compliance rules for Instant Funding accounts. The EA must NOT trade automatically — it should only monitor and control my manual XAUUSD trading. I trade all sessions, so there should be no time restrictions. MY TRADING STYLE (Important
​1. Project Overview ​ Asset: XAUUSD (Gold) ​ Timeframe: M1 (1-Minute) for execution; M5/M15 for trend filtering. ​ Objective: Execute high-frequency scalps during peak liquidity (London/NY overlap) to capture 10–30 pip movements with high precision. ​ Core Logic: The "Poverty Bot" strategy relies on Mean Reversion combined with Momentum Burst (Price Action + RSI/EMA filters). ​2. Strategy Logic (The "Poverty"
I need any highly profitable robot which can trade small account like 50-100USD and any currency pair(s) The robot should avoid trading around news time and have good risk management. It should use any strategy which is profitable and not those unacceptable by brokers. Demo versions will be required before selection
Hi, I hope you doing Greate, Let me share details , so the original EA already working but you can check and verify everything fine.First you verify that all original EA features are working correctly then add a user dashboard showing the number of detected zones, buy sell both none status, and an on off button. also ensure mitigated zones disappear properly and that trades follow the zone rules, and integrate the
I need a high-speed Expert Advisor (EA) for MT5 designed specifically for XAUUSD (Gold) scalping. The bot should focus on fast entries and quick profits with high efficiency. Main requirements: 1. Symbol: XAUUSD (Gold only). 2. Platform: MetaTrader 5. 3. Strategy type: Scalping (fast trades, quick profit). 4. The bot should open trades frequently based on fast market movements. 5. Small Take Profit (quick profit
Gold_m1_ob_bot. 30+ USD
import MetaTrader5 as mt5 import pandas as pd import time from datetime import datetime # ================== CONFIG ================== SYMBOL = "XAUUSD" TIMEFRAME = mt5.TIMEFRAME_M1 LOT = 0.01 MAX_OBS = 12 # keeps signals frequent ATR_PERIOD = 14 IMPULSE_FACTOR = 1.5 # strong candle = impulse SESSION_START = 8 # GMT (London open) SESSION_END = 20 # GMT (NY close) MAX_SPREAD = 30 #
I have existing compiled indicator and script files (EX4) and would like to have them recreated in both MQL4. ⚠️ Important: This project is NOT for decompiling or reverse engineering. Instead, the goal is to: Analyze the behavior and output of the provided files Recreate equivalent functionality from scratch Deliverables: 1 MQL4 indicator source code (.mq4) 1 MQL4 script source code (.mq4) Requirements: The recreated
I need a good programmer to help convert an existing indicator to a trading EA that can work on both MT4 and MT5. The expected features on the EA is as follows: Max Spread: Magic Number: Take Profit: Stop Loss: Trailing Stop: Fixed Lot Size: Money Management: false/true Min Lot Size: Max Lot Size: Risk to Trade %: Daily Profit Target %: Add news filter. Get my jobs with source code
A perfect indicator 30 - 80 USD
Merge nearby zones yes/no Alert on/off Label on/off Show only current relevant zones near price yes/no Distance filter from current price Zone transparency Colors Preferred Output on Chart: I want the indicator to show only: the strongest nearby support zones under price the strongest nearby resistance zones above price major higher timeframe zones clean chart view I do not want excessive clutter. Entry Assistance
Criei um Robô para a venda alta precisão que automatiza a estratégia de correção média de Larry Williams. Possui filtros de tendência seletiva, controle de lote por risco percentual e execução rápida. Compatível com contas Hedge e Netting. Configuração simples e otimizada para mercados de alta volatilidade. *55(16) 993786056

Informazioni sul progetto

Budget
30 - 60 USD
Scadenze
a 20 giorno(i)