Drawdown Limiter User Guide

Drawdown Limiter User Guide

22 March 2023, 07:41
Haidar, Lionel Haj Ali
2 666

You are in the right place if you were searching for Drawdown control, Drawdown limiter, Balance protection, or Daily Drawdown Limit related to Prop Firm, FTMO, My Forex Fund, or Funded account trading, or if you want to protect your trading account.

I am Lio, I am an EA automated trader, and I developed this utility to help me respect account drawdown rule imposed by FTMO, and I am proposing it here to help you too. Draw Down Limiter is the ultimate risk management tool that ensures your trading account stays afloat during volatile market conditions. Its algorithms detect potential drawdowns and automatically limit your losses, preventing your account from being wiped out. It helps you meet your daily drawdown targets, increasing your chances of successfully securing funding from top trading firms like FTMO, My Forex Fund, and others.

In this user guide you will be able to read about the following: 

  1. Introduction
  2. Where to download DrawDown Limiter
  3. DrawDown Limiter Functionalities
  4. What DrawDown Limiter can't do
  5. The settings
  6. How to read the traffic Light
  7. How to configure a portfolio drawdown
  8. How to use it with "Algo Trading Disabler EA" 
  9. Limitations that MT4 users need to be aware off
  10. Limitations that MT5 users need to be aware off
  11. Frequent questions received by the users


If  you are tired of watching your trading account balance dwindle down to zero after a few bad trades, If you struggle to meet your daily drawdown targets imposed by funding organizations like FTMO and My Forex Funds, look no further than DrawDown Limiter, the expert advisor that protects your account from catastrophic losses and helps you meet your funding requirements. It can protect you via bad days, market fluctuation during news period or even from a buggy EA or a bad signal you are copying. With Draw Down Limiter, you can trade with confidence, knowing that your account is protected from the unpredictable nature of the markets. So, whether you're a beginner or an experienced trader, add Draw Down Limiter to your arsenal and take your trading to the next level.

This EA is ideal for copy trading or EA trading with a prop firm. DrawDown limiter will help you in:

  1. Tracking the account drawdown
  2. Tracking the daily trader drawdown
  3. Prevent you from overtrading by limiting open position
  4. Alert you when you are taking high-risk trades
  5. Help you define a risk portfolio

"Draw Down Limiter" is designed to respect the two major prop firm rules. All others should also fall in without any problem. The EA is compatible with FTMO and My Forex Funds. You can check all  the details on this blog separate blog: FTMO and My Forex Fund rules compatible EA: DrawDown Limiter.

If you are trading from the USA or you have FSA regulations to respect, DrawDown Limiter is compatible with the NFA FIFO rule. You will find all the details on the following blog:  DrawDown Limiter compliance with NFA Rule 2-43b FIFO rule.

Need help or have questions? I am Lio, don't hesitate to reach out!  We are always available to respond, help, and improve. Our support channel is always here for you.

Where to download Draw Down Limiter

Draw Down limiter is available for MT4 and MT5, you can find the EA under:

The expert advisor’s essential function is to monitor all the activities on the account, if it was a manual or automated trade by another expert advisor. You need to add it to a chart, and it will take control. 

You will first notice a "Traffic Lights" on your screenIt's "Traffic Lights" feature will keep you informed about the four KPI mentioned above in a simple graphical manner. The EA comments can be hidden and customizable to match your preferred colors and fonts. In One click, the details page can simply be hidden to gain some space on the charts. The position and style of the traffic lights can is super customizable to match your chart's style.

It has four different key measurements to track:

  1. It monitors the Global Account Drawdown (GDD) by comparing the initial account size and current equity
  2. It calculates the Maximum Daily Loss (DDD) = results of closed positions of this day + the result of open positions compared to your starting balance, equity, or money value you define in the configuration
  3. It will check and set controls on the number of simultaneous open trades (OTRD)
  4. It will track and set controls the current positions open and closed in the range (ATRD)

The EA will track and display your daily profit/loss based on a frequency defined in the inputs. Once the Account (GDD) or Daily trader draw-down (DDD) percentage is reached, it closes all open positions and orders. Any new order will be instantly closed.
On the other hand, the EA will track all currently opened positions (OTRD), and the total of positions opened during the day  (ATRD). Once the limit is reached any new trade will be automatically closed. The DrawDown limiter works as a notifier in case you are taking high-risk trades, in case a trade is set without SL or the risk you are taking is higher than what you set at the threshold.

The showed value is a percentage of the allowed drawdown. Let us explain it with the following example

  1. Starting Balance is 11197.78, Max Daily DrawDown is 1%, which gives us a Max Daily DrawDown amount is 111.98 
  2. If your current P/L is -76.93. The calculation afterward is done as follows: (-76.93/-111.98) * 100 = 69%The 69 is shown in the traffic light and the percentage. 

At the end of the day or mentioned range, the threshold is set back to zero, and a new day begins. However you have an 'End of Range security zone" this will help you to protect your funded account is a very specific case when you are starting a new day with a open positions loss higher than your daily account drawdown. Check the below example form FTMO.

FTMO rule: Be careful as the Maximum Daily Loss resets at midnight CE(S)T! Let’s say that one day you had a profit of $4,000. On the same day, you have an open position with a currently floating loss of $13,000. On this day, the maximum daily loss is not violated. The current daily loss is $9,000. ( $4,000 closed profit – $13,000 open position). However, if you hold this position with an open loss of $13,000 after midnight, the daily loss limit will be violated. This is because your previous day profit doesn’t count to a new day and the open loss of $13,000 exceeds the max daily permitted loss of $10,000.

The size of the Maximum Daily Loss gives trader enough space for trading and it guarantees a clearly defined daily risk to the investor. Both the trader and investor benefit from this rule as the account value will not drop below the limit. That’s also why the Maximum Daily Loss limit includes your possible floating losses.

DrawDown limiter will also alert you in case you are opening a trade without SL or with a risk higher than the one you have defined by trade. The only action took here for a smooth user experience is to alert the user so they can manually take actions.

In addition, the EA have set of actions that can be configured. It  can send you push notifications to keep you posted of its actions and activities. You can skip the check frequency and close your trades on the new tick if drawdown is reached. You can activate FIFO rule. And you can ask DrawDown limiter to close your MetaTrader platform or charts, it will reopen only on the next day or on new range starts.

If you are interested to get a EA that automatically toggle "Algo Trading" ON and OFF based on your drawdown, don't hesitate to contact me once you purchase DrawDown limiter to share it with you for free. 

An finally, advanced mode of this EA, if you are an expert advisor developer, is to use to complete your current expert advisor. The Drawdown Limiter EA can pass instructions to prevent your EA from sending orders, and this will help you not to pay commissions for trades executed after the drawdown limit is reached. The advanced mode will help you stop your other EA from trading. "DrawDown Limiter" needs to run on a chart on your account where other EA are running. Once the drawdown threshold is reached, it will create a Temp Global Variable with the name you defined in the inputs: “ GV to use in other EA”, for example GV_isDD. Check https://www.mql5.com/en/docs/globals for more information about global variables. In your EA you can check if this variable exists, and if it is the case you don’t take a trade. At the end of the range/day, "DrawDown Limiter" will remove the Global Variable allowing your EA to take trades again

   //If daily DD reached
Print("Max Daily DrawDown Active. No more trades will be opened!");
} else
  …Your logic to open a trade...

What Drawdown Limiter can't do

I am adding this section to explain what DrawDown limiter can't do. What you need to understand that you have 4 different parties in a trading journey. The user or EA that is putting and managing the orders. To do so they do it via MetaTrader Terminal. The terminal role is to rely the message such as creating new orders, modifying the stop loss, or closing orders to the MetaTrader server. The server is responsible of the execution of those orders. Drawdown limiter interacts with the terminal. It reads the history and current positions that the Terminal. DrawDown Limiter can then analyze the data and take actions. Drawdown limiter cannot interact with the Server neither to anticipate the user or EA commands.

So in the list that Drawdown will not be able to do are: 

  • Force the user or EA to respect a certain risk while opening the trades.
  • Force the user or EA to set a stoploss for each new position
  • Prevent the user or EA to create new trades after drawdown is reached
  • Prevent the opening of a position with a certain risk rule on certain currency
  • Handle any mechanism for account password modification or inputs modifications vs a password
To keep it simple: DrawDown Limiter will only act after the User/EA or Metatrader server and never before.

The Settings

The EA setting are quite simple and divided into different logic group.

Below you will find a details explanation on how to use each input.

    • Magic number: It keeps track of the trades closed by the EA - if you are launching multiple instances of DrawDown Limiter please make sure to choose different Magic Number for each instance. Generally speaking, every EA, even if it is not DrawDown limiter, needs to have a unique magic number on its own.
    • Trade comment: Comment included in the order executed by DrawDown Limiter, and the notifications sent.
  • Define your reset range
    • Drawdown Reset Cycle: You can even choose a cycle on the opening of the daily bar or a specific range. If the latter is chosen, you must define your start time range.  The specific range will be compared last known server time visible in the Market Watch window.
      • Specific Range hour (0-23): Start hour of the range.
      • Specific Range minute (0-59): Start minute of the range.
    • Skip Weekends: If you are trading crypto on weekends, this option is for DrawDown limiter to keep track on weekends too
  • Account Overall Drawdown
    • Initial Account size: Set your initial account balance to monitor its overall drawdown
    • Max Account DD %: This percentage will help update the GDD light and alert you how far you are from your limits

  • Daily Drawdown
    • Choose what to control: This option will allow you to configure DrawDown limiter to monitor your account, a specific EA, or multiple EA trades. Check the "How to configure a portfolio drawdown" section to know more.
    • Set specific EA Magic Number: If you choose to control a specific EA, you need to define its magic number in this field. If you choose to configure multiple EA make sure you enter the EA magic numbers with comma separated. Example: 52896,55884,12365,45879
    • Drawdown Calculation Options:  You can choose to calculate the drawdown (1) from the initial deposit amount that you set, usually FTMO imposes this rule, (2)from the equity, (3) from the balance at the start of the day, (4) from the maximum value of equity or Balance at the start of the day, which is a rule from My Forex Funds, or if you wish to set the drawdown in (5) money value. The EA will monitor and reset the base from which it calculates the drawdown on each new range and use it as a reference.
    • Initial Deposit or Risk In Money: If you choose to calculate the drawdown from the initial deposit (option (1)) or set it in money value (Option (5)), you need to specify the amount here.
    • Max Daily DD %: The maximum daily drawdown percentage. Once set, the money value is calculated from Initial Deposit, Account Balance, Or Account Equity. Usually, the daily drawdown is 5% in most Prop Firms. I recommend having some margin and configuring it to 4%. Assuming you are starting from a 10000$ balance, once the EA detects 400$ loss, it will trigger the security option and delete/close any new trade.
    • Include Swap and Commission: Include Swap and Commission in your Draw Down calculation. Some of the Prop Firms require this.
  • End of Range security zone settings
    • Close Open position if DD reached in Security Zone: This enable security zone at the end of the day to help, check the FTMO blog for more details
    • End of Range Security Zone in minutes: The size of security zone in minutes, usually a 5 minutes zone is more than enough
    • Security Zone risk from Daily DrawDown: Let us say you are risk 5000USD as daily drawdown, in this parameter you specify the threshold from the daily draw down to respect in the the security zone. So choosing 50% means, that if the floating loss is eaqul or higher that 2500USD the trades will be closed.
    • Stop overtrading  - I encourage you to learn self-discipline and not let the Draw Down limiter prevent you from overtrading. This skill is a must if you need to evolve as a trader. 
      • Max Number of range positions: Set the maximum number of simultaneous trades allowed. Trades are closed positions or open positions. Partial take profit linked to one position is considered as one position. A pending order is not considered a position before it is triggered.
      • Max Number of open positions: Set the maximum number of currently open positions. A pending order is not considered a positions before it is triggered.

    • New Trade Risk Alert
      • Alert for trade with no SL: Set to true to activate the alert for trades without SL
      • Alert for trade with risk: You can choose to be alerted if certain trades are set and not respecting your risk as a percentage from balance or equity, or simply a money value.
      • Max % or Money Value: The risk percentage value from balance or equity, or the money value to risk per trade.
    • Actions Settings:
      • Send Notifications for each actions : Enable sending push notifications on each action took by DrawDown limiter
      • Close extra trades on next tick: This option will allow to close any extra trade on next tick when drawdown is reached instead of waiting for frequency timer.
      • NFA BROKERS - FIFO rule: You can enable or disable FIFO compatibility, and when enabled you have two modes, don't hesitate to check this blog about FIFO compliance for more details

      • Terminal Action When DD or Max Trades reached: This will allow to automatically close the terminal with DD or max trades  threshold is reached, or keep it open to manage current running positions
      • Close Other Charts When DD or Max Trades reached: This will allow to automatically close all other charts with DD or max trades  threshold is reached, or keep it open to manage current running positions
      • Traffic Light Position: Chose default position, top left, top right, bottom right, and bottom left
      • Traffic Light Style: set your traffic light horizontally or vertically
      • Vertical and Horizontal Traffic Light Shift: use those parameters to manually shift borders 

      • This will allow you to set the Details Font, colors so DrawDown Limiter match your charts and your style
      • GV to use in other EA: This is the name of the Global Variable created by the EA. If you are an mql developer, you can check this Global Variable in your code to prevent opening any new position if the draw-down threshold is reached. This is the same that you need to use when using the "Algo Trading Disabler"
      • Check Frequency in Milliseconds: The frequency to check open trades in milliseconds. It depends on your computer spec and number of Draw Down limiter you launch, but to give you an example I run with no issue on a VPS of 2GB RAM, 2 CPU and 30 GB SSD, I run over it around 10 MT5/MT4, with different EA, and usually I have at least one DrawDown Limiter on each account.

        How to read the "Traffic Lights"

        The "Traffic Lights" is added in order to quickly and visually get the information on the current drawdown level or on the number of trades threshold. It includes four squares.

        1. GDD%: Represents the global account drawdown from an initial balance.
        2. DDD%: Represents the Daily Draw Down percentage.
        3. OTRD: Represents the current open positions.
        4. ATRD: Represents all the positions (open and closed) inside the range.

        GDD% is calculated from the initial account balance vs the current equity. Its color varies based on the drawdown configured for the account.
        DDD% is calculated as the percentage of the "Current range floating profit or loss" from "DrawDown maximum amount". Drawdown lights have four colors:

        GDD% value is a percentage of the allowed drawdown. Let us explain it with the following example

        1. Starting Balance is 11197.78, Max Daily DrawDown is 1%, which gives us a Max Daily DrawDown amount is 111.98
        2. If your current P/L is -76.93. The calculation afterward is done as follows: (-76.93/-111.98) * 100 = 69%. Then 69 is shown in the traffic light as the percentage. 

        • Green: the current range is in profit
        • Orange: the current range drawdown is less than 50%
        • Orange Red: when drawdown is between 50% and 75%
        • Red: when the drawdown is beyond 75%

        ATRD is the sum of "Total range positions", while OTRD is the number of simultaneousopen positions. The trades threshold lights have three colors:

        • Green: Less than 50% of trades threshold
        • Orange:  current trades number is between 50% and 75% of the maximum allowed
        • Red: when the threshold is beyond 75%

        How to configure a portfolio drawdown

        If you have multiple EA, and you want to assign a risk for each one of them, with DrawDown limiter version 3.3 you are able to do that and manage your portfolio risk accordingly.

        In the example below we are splitting the risk among three EA, and therefore we are starting four instances of DrawDown limiter, one for each EA and one for the Account.

        If you want more details about how to configure a portfolio drawdown management, I invite to take a look on the following video:

        How to use it with "Algo Trading Disabler EA"

         If you are a fully automated EA trader, that I am sure this chapter will interest you. If you are looking for an additional free EA to help you stop your Algo Trading when drawdown is reached, reach me out to share with you for free the "Algo Trading Disabler" EA. It is free, just load it on your charts and let the magic take place. It will disable and enable algo trading for you automatically as soon as drawdown is detected by DrawDown Limiter. For more information check the following video. The "Algo Trading Disabler" is not uploaded to MQL5 market as it prohibit DLL import. Please make sure you enable DLL import in MT4 and MT5 when using this EA.

        In order to limit any race condition between DD Limiter and Algo Trading disabler make sure to set frequency of scan on Algo Trading disable 3 to 5 times higher than DD Limiter. However all this depends on your own trading style, meaning if you have couple of trades you will not have any problem, but when you are doing high trade number strategy and you a 50 trades and more DD limiter will need time to close all of them. Starting version 3.6, as long as a trade is still open DD limiter will not ask Algo Trading Disabler to switch algo trading off.

        Limitations that MT4 users need to be aware off

        MT4 do have couple of limitation when it comes to the use of such utility.

        1. The first one is that you cannot do the same test in the strategy tester as for MT5, this is a limitation in MT4 where the OnTimer() function is not implemented in the tester.
        2. MT4 does not implement a unique position ID or trade open time in milliseconds. Therefore the partial closed positions are detected by combining uniqueness using open time, open price, symbol, type of the operation, and magic number. If you execute 2 similar trades with the same information they will be counted as unique position.
        3. The second point which is THE MOST IMPORTANT, in MT4 the order history is read from your terminal history tab, so make sure you have selected the right time frame. This is due to the limitation of OrdersHistoryTotal() function in MT4, you can find the reference under: https://docs.mql4.com/trading/ordershistorytotal. However in MT5 this limitation do not exist as we can load the history based on a start and end date directly in the EA what ever the history selected in the terminal. This is available via the HistorySelect() function in MT5, you can find the reference under https://www.mql5.com/en/docs/trading/historyselect.

        To illustrate this limitation for you, you can find follow the screen shots below, with actions done as follow: 

        1. We have selected "All History" in the account history tab, you can notice that today's drawdown was -4%
        2. As soon as we manually change the dates in the history tab to another date, DrawDown limiter changed the drawdown to 0, which is not accurate.
        AS AN ADVICE, please even select "All History" or simply "Today" in the history tab so DrawDown limiter can perform the task requested from it.

        Limitations that MT5 users need to be aware off

        Franckly speaking MT5 is much avanced than MT4. However, you have one information that you need to take into consideration when trading with MT5 which is the difference between a DEAL, an ORDER, and a POSITION. You can go for the long description that is avaialble under this article: https://www.mql5.com/en/articles/211, or you can just take the below as a limitation that DrawDown Limiter can't handle.

        1. Commission Calculation in P&L: A trade in MT5 is done through a DEAL_IN and a DEAL_OUT. Some brokers apply commission on DEAL_IN and DEAL_OUT, others on only DEAL_IN, and there is a third category that apply the commission only on DEAL_OUT. The impact on DrawDown Limiter is that when ever you have commission on DEAL_IN, and even if the position is not closed, this commission is counted in the closed profit as it is due. Check the example of the last open trade below on GBPAUD, the position is still open, however the  commission is due for the DEAL_IN
        2. Specific EA DrawDown Limiter and closing the trades manually: Same as above, when an EA take a trade the DEAL_IN is counted as issued by the EA, however if you intervene manually to close those trades, the DEAL_OUT is considered as manual trade and will not be counted by the specific instance of DrawDown Limiter that is managing that EA. Check in the picture below the  GBPAUD trade with 3.85 as volume. The DEAL_IN is took by the EA with magic number is 231, while the DEAL_OUT no magic number is assigned as the trade was closed manually.

        Frequent User Questions

        If I trade multiple pairs, should I open a drawdown limiter for each pair? 

        If you are not using EA specific drawdown, you need to run only one drawdown limiter for you entire account. You can put it on any charts. I recommend one of the major pairs so you can benefit from frequent tick coming in. If you trade cryptocurrencies on weekends make sure to run drawdown limiter on a pair where the market is open so it can read market info and act.

        Should I use reset on daily bar opening or specific range? 

        Almost all prop firm reset their counter on the daily bar opening, which refers to 5PM EST. However if you have a specific need to control the drawdown on a different range, you can choose reset on specific time option.

        What should I choose as a base to calculate my drawdown? 

        If you are a prop firm trader you new to refer to your firm FAQ, but you can find some explanation on the following blog for FTMO and MFF. If you are using DrawDown Limiter for you own account trading, you may set a fixed money value not to go below during a day which I usually do on my personal accounts.

        How DrawDown Limiter decide what is the starting Balance or Equity?  

        DrawDown Limiter on the first start it will take the CURRENT equity or balance as it doesn't have the exact balance when the day or range started. When you leave DD limiter running on your charts if you are using a VPS for example, at the end of the range DD limiter will catch the new Equity and Balance at the start of the range and use as reference. As long as you don't close the chart, remove DD limiter, or close your MetaTrader, DD limiter will keep the captured equity and balance at the start of the rage as reference. 

        What to do once a withdrawal is made on the account?

        Your equity or balance is adjusted at the end of the day if you choose those as references to calculate your drawdown from. However, if you have chosen a manual deposit, or a manual max amount as a daily drawdown, you need to adjust those manually.

        If I am doing a challenge with 5% daily drawdown, should I use the entire 5%? 

        No, this is not a good idea. If you hit the 5% means you lost your challenge. You need to target 4 or 3.5% maximum. If you are using a high frequency trading system that opens a lot of trade, you mean to consider even a lower percentage. If your ping to the broker server is low, you need to count 1 second to close 3 trades.

        Can DrawDown Limiter estimate the starting day balance or equity is started in the middle of the range? 

        Up to the current version this is not included, but it is part of the next releases.

        When drawdown reached, what are the actions took by DrawDown Limiter? 

        When you have even a daily or account drawdown threshold breached, DrawDown limiter will first close all open positions, then delete all pending orders, then close the other charts if this option was activated, and finally close the terminal if this action is activated.

        When I reach the max open position or max positions during the range, what are the actions took by DrawDown Limiter? 

        If you reached the max open positions, DrawDown Limiter will only close the new trades if FIFO rule is not active. For more details about FIFO rule I invite to check the following blog.

        If you reached the mac position per day, DrawDown Limiter will first close the new trades as per the point above, however, it will also close all your charts if activated, and may also close your terminal if activated.

        I configured terminal to close after my drawdown is reached and I can't wait the next 24 hours to access, how to access my account? 

        The workaround to get access to you account are:

        1. You install another mt4/mt5 and you log in
        2. You remove the drawdown limiter.ex5 from the current terminal files.

        For the second option, go under the data folder of your MetaTrader, this is located under: C:\Users\<USER>\AppData\Roaming\MetaQuotes\Terminal\<D0E8209F77C8CF37AD8BF550E51FF075>. Pay attention that <USER> is your PC user. and <D0E8209F77C8CF37AD8BF550E51FF075> is your terminal ID so they can be different than the one I am showing you here. Once there, go under MQL5\Experts\Market and cut the drawdown limiter from this folder and save it in another folder, you need to put it back once the terminal has started. Start your terminal again.

        Do you recommend to activate over trading limit and closing the terminal? 

        I firmly believe if you want to succeed as traders you need to learn self control and discipline. It is a must to have skill as a trader. I personally don't use this option, and I encourage you not to do it.  

        I am using specific DrawDown Limiter instances for each EA I have, what do you recommend?

        I recommend first to have a global instance of DrawDown Limiter to manage you account in addition to the specific one by EA. I would set the refresh period on the master instance the double of what is set for the EA specific one. Make sure you are using different Magic Numbers for each instance of DrawDown Limiter. You can find more details in the section "How to configure a portfolio". drawdown

        Why the check is not done on tick and is done on refresh period? 

        Using on tick will be dependent of the price delivery of the pair where DrawDown limiter is loaded. You may find your self on a steady pair with no ticks - check for example BTCUSD during weekends. So using a refresh period is more secure.

        What do you recommend as refresh period? 

        All depends on your computer or VPN specifications, how many trades you have in your history, if you are using FIFO rule or not, and how much DrawDown Limiter you are launching on your account. There is no specific rule for that, but to give you an example I run with no issue on a VPS of 2GB RAM, 2 CPU and 30 GB SSD, around 10 MT5/MT4, with different EA, and usually I have at least one DrawDown Limiter on each account.