
Explore practical risk management in algorithmic trading with MQL5, implementing fixed-size and fixed-percentage risk, equity-based and lockstep sizing, a reusable risk library for expert advisors, and martingale concepts.
Use the ADX indicator to spot consolidation below 25 and breakouts above it. Place two pending orders to capture breakouts with a 1:2 risk-reward.
Create an expert advisor for the 80x breakout in mql5, implementing on initialization and on tick functions, with a 14-candle lookback, 25 level, and risk management folder.
Initialize the 80 x indicator handle, set series flags, and implement range beginning and range ending functions during initialization to detect breakout periods using candlestick data.
Capture the range beginning and range ending times, count the bars in the range, and resize arrays using the pass function with symbol, period current, start time, and stop time.
Implement MQL5 range high and range low calculations by resizing arrays, copying highs and lows for the selected range, and identifying the highest and lowest prices to signal breakouts.
Calculate the range size from high and low at range end, convert to pips, and visualize each range by drawing a unique rectangle on the chart for clear risk insight.
Master mql5 risk management by configuring an expert adviser with general and target inputs, displacement in pips, stop loss, take profit, and range filtering for trades.
Learn to implement buy stop and sell stop orders in MQL5, calculate take profit from pips, convert stop losses to price values, apply displacement to filter breakouts, and use GTC.
Learn to manage algorithmic trades in MQL5 by creating a void function to delete pending orders, retrieve and delete OTA tickets, and control entry with range beginning and positions total.
Fixing bugs in an expert advisor, this lecture demonstrates filtering out large ranges with a range size check and refining buy/sell logic using entry prices and stop losses.
Explore three money management groups—percentage-based risk (balance, equity, free margin), fixed risk, and fixed balance with step sizing—and compare compounding effects across them.
Enhance an expert advisor with a money management function by cloning the advisor, including symbol, account, and position info, and adding a risk type enum for fixed or percentage balance.
Create a dynamic lot size function that risks a percentage of the account balance. Use tick value and max volume checks to switch fixed and calculated lots.
Explore risk management by calculating risk from account equity rather than balance, with a switch to percentage equity, fixed lot options, and live risk calculations for multiple trades.
Demonstrates fixed balance risk management in the MQL5 advanced course, showing how a fixed balance (e.g., $8,000) determines risk and losses regardless of account size.
Use free margin to determine risk amount by applying a percentage of available free margin retrieved from account info, calculated as free margin times percentage risk divided by 100.
Implement fixed risk money input to cap risk per trade, independent of account size. Use a fixed risk value like 32.50, rounded to 33 with a 50,000 balance.
Explore lock step risk management in MQL5, implementing balance-based lot sizing that scales per $100 and adapts with balance thresholds to control losses.
Compare fixed lock step and dynamic lock step, showing how fixed lock step keeps lot size constant until a balance threshold is exceeded and rounds down with net flow function.
Create a reusable risk management function library in MQL5 called risk manager, convert inputs to function parameters, include it in expert advisors, and validate through compilation and testing.
Discover three martingale styles—traditional, reverse (anti) martingale, and semi martingale—and compare how they manage money, risk, gains, and drawdown versus conservative strategies.
Develop an mql5 expert advisor for the 80 x breakout strategy with martingale risk management, adding inputs: use martingale (default true), next-trade multiplier, and a four-trade limit.
Create a martingale lot function and initialize win and loss counters to zero. Use history select to fetch deals and iterate to update counts by profit, resetting on breaks.
Learn to manage martingale risk in algorithmic trading by calculating lot sizes from losses, applying a martingale multiplier, and enforcing max/min volumes.
Explore reverse martingale risk management in MQL5 advanced, implementing an anti-martingale option with fixed lot, normal martingale, and reverse martingale modes in an expert advisor for algorithmic trading.
Implement semi-martingale risk management by adding semi matching and adjustable lot sizing, including fixed, martingale, and reverse martingale modes using last-trade volume for calculations.
Build a reusable risk management function library for any expert advisor by copying and integrating parameterized functions, including symbol, martingale settings, multi-layer size, and limits with an include mechanism.
Conclude the MQL5 advanced course by inviting feedback to improve content and your algorithmic trading learning journey. Explore our other algorithmic trading courses to deepen risk management skills.
There are three pillars of trading that are prerequisite to consistently profiting from the markets. These include having a good trading strategy, having a good trading psychology and having a good money management plan in place.
Money management is usually the least focused on yet it is the most important tool a trader can use to continue reaping benefits from the market. Its neglect is the major cause of failure in most trading strategies regardless of whether they are manual, or automated.
The main concept of money management lies in the acknowledgment of risk in every trade executed in the market. It is a reflection of awareness on what the future holds in the worst case scenario for every trade entered. It can assist a trader in determining how much they are willing to lose without affecting their ability to trade in the future.
In this course, I will be sharing with you some knowledge on how to incorporate Money management capabilities into algorithmic trading softwares to ensure that your automated strategies respect the money management policies of your preferences.
I will walk you through the many different forms of risk management and explain to you in great depth and simplicity on how we can code these different capabilities into an expert advisor.
I shall explain on different scenarios where you may use each type of risk management and highlight its strengths and weaknesses in algorithmic trading.
Enriching your algorithmic trading softwares with proper and automated money management protocols is a very crucial aspect of being a consistently profitable trader and that is why I am inviting you to press hard on that enroll button now, and join me as I guide you through the thick jungle of risk management protocol incorporation using the MQL5 algorithmic trading language.
What you will learn:
1. How to create a Breakout expert advisor with MQL5
2. How to risk a percentage of Balance per trade with MQL5
3. How to risk a percentage of Equity per trade with MQL5
4. How to risk a percentage of fixed balance per trade with MQL5
5. How to risk a percentage of free margin per trade with MQL5
6. How to risk a fixed amount of money per trade with MQL5
7. How to risk use Lot Step or Auto Lot in MQL5
8. How to implement Martingale with MQL5
9. How to implement Anti-Martingale with MQL5
10. How to implement Semi-Martingale with MQL5