
Explore the disclaimer around algorithmic trading in MQL5 and how to code robots to free up your time.
Discover how automated algorithmic trading uses backtesting on historical data with a simple moving average bot in MetaTrader 5 to test strategies, scale across charts, and free your time.
Set realistic expectations for algorithmic trading, noting variable income, no guaranteed profits, and risks, and learn to program, test on historical data, and deploy your own automated trading robots.
Explore algorithmic trading in mql5 by building code robots and freeing up your time, guided by a two-part course with practical assignments and a final trading robot.
Explore MetaTrader 5 as a trading platform for forex, stocks, and futures, featuring a powerful strategy tester and broad assets, plus Mql5 and MetaEditor from MetaQuotes.
Explore MetaTrader 5 basics for algorithmic trading, including chart types, timeframes, market watch, symbols, and the strategy tester for back and forward tests.
Compare Metatrader 5 netting vs hedging position accounting, showing how netting merges positions per symbol while hedging creates independent positions with tickets that require specific closures.
Explore MQL5 applications, including expert advisors, indicators, scripts, services, libraries and include files, and learn to code trading robots, perform technical analysis, and run chart-attached or one-off programs.
Explore the meta editor interface—top menu, navigator window, and toolbox window—to create files, compile scripts to x5 executables, and use autosuggestions and autocompletion.
Create your first program and display hello world in Metatrader five by writing, compiling, and running a script on a chart while connecting to a demo account.
Learn how to use the onstart event, create variables, and write expressions in mql5, with correct semicolon placement, and how the alert function displays messages in the terminal.
Learn how identifiers name functions and variables in MQL5, follow rules on max 63 characters, allowed characters (letters, digits, underscore), case sensitivity, and reserved words, using camel case for consistency.
Explore how comments organize code and explain decisions, using single-line comments with two slashes and multi-line comments with slash asterisk, to separate sections and guide teammates.
Examine data types in Mql5 and learn to store, access, and manipulate data with variables for algorithmic trading.
Learn how to declare and use variables in Mql5, allocate memory, and assign values using types like double, with examples of operations, functions, and handling warnings and string conversion.
Learn to declare variables with the correct integer data types in Mql5, including char, short, int, long and their unsigned variants, and understand memory ranges to avoid truncation.
Learn how the boolean data type stores true or false values and how to use boolean variables with conditional operators like if to drive actions in MetaTrader scripts.
Learn how the color type stores colors in MQL5 across literal representation using the RTP code, integral representation using decimal, and web color representation using color names and constants.
Store dates and times with the DateTime type by counting seconds since January 1, 1970, using string constants and print compilation date and date time values in Metatrader.
Define an enumeration as a special integer type for days of week, assign values, declare variables, and print or convert them to strings.
Understand real types in MQL5 by comparing float and double: float uses four bytes with seven-digit accuracy, while double uses eight bytes with sixteen-digit accuracy, and truncation guides precision choices.
Learn the MQL5 string type for text, declare and print strings, and escape quotes with backslashes. Explore concatenation using the plus operator and the string concatenate function with comma-separated arguments.
Explore how to declare and use static and dynamic arrays in MQL5, including indexing from zero, filling elements, and printing specific indices in a practical script.
Demonstrate using dynamic arrays in mql5, resizing with array resize, assigning values to index three, and printing results to show dynamic arrays can mirror static arrays.
Explore multidimensional arrays as arrays of arrays with two dimensions, access elements by [row][column], and identify out-of-range errors to build robust indexing in MQL5.
Learn to declare and use a structure in MQL5 to hold order parameters like price, stop loss, take profit, slippage, volume, and order type, and access them via an object.
Learn how to use a predefined mql5 structure to retrieve prices and tick data. Create a tick info object and fill its fields from the server, including bid and ask.
Explore how constants work in MQL5 by comparing define preprocessor constants with const variables, using a system name and a fixed price to illustrate immutability and compile-time checks.
Learn how type casting converts data between int, char, float, and double, noting potential data loss and the role of implicit versus explicit conversion and compiler warnings.
Explore predefined variables in Mql5, such as digits, point, last_error, period, and symbol, and learn to print them and convert period to string using the enum to string function.
Learn how global and local variables work in MQL5, with scope rules that confine locals to blocks and allow globals to be accessed throughout the program.
Learn how to use input variables in mql5 to adjust stop loss, take profit, and moving average from the mt5 terminal, enabling quick backtests and deployment without modifying code.
Test and fix a script to practice declaring variables and data types in MQL5. Explore enums, structures, arrays, scope, and choosing types like boolean, long, and char.
Introduce section 3 and cover operation types in article five, including arithmetic, assignment, relation, and boolean operations.
Explore MQL5 arithmetic operations by declaring and manipulating integer variables, performing addition, subtraction, multiplication, division, remainder, and increments, then printing and verifying results.
Learn how precedence rules determine the order of operations in expressions, with multiplication taking priority over addition, and how parentheses override priority to produce correct results in MQL5.
Learn how to use the assignment operator in mql5 to assign values and combine with arithmetic operations, including plus-assign, minus-assign, multiply, divide, and remainder.
Explore relation operations in MQL5 to compare values, including equality, not equal, less than, greater than, less than or equal to, greater than or equal to, yielding true or false.
Explore boolean operations in MQL5 using and, or, not to compare variables and evaluate true or false within if statements, with practical examples and printouts.
Practice debugging an MQL5 script by adjusting arithmetic, logical, and boolean operators in if conditions to turn false tests into true, triggering six prints and an extra statement.
Explore choice and loop operators, control flow concepts that decide when to execute code and how to repeat it, including if else, ternary, switch case, do while, and for.
Explore the if-else operator as a control flow tool in mql5, evaluating a condition and executing expressions when true. Use boolean and relational operators with full or single-expression forms.
Master the if-else control flow in MQL5 with if, elseif, and else to evaluate conditions and select the executed block, understanding that elseif runs only when prior conditions are false.
Learn how the ternary operator compares to if-else by returning a value in one line and assigning it to a variable, using a string message example.
Learn how the switch operator compares an expression with constant cases, uses break to stop further cases, and provides a default for unmatched cases in MQL5 scripts.
Explore loop operators, focusing on while, do while, and for, to control execution with true/false conditions, implement a countdown, print values, and prevent infinite loops in MetaTrader.
Discover how the do-while operator in MQL5 differs from while by executing the loop body at least once, then repeating while the condition remains true in Metatrader.
Explore how the for loop compares to while, using a countdown example to show initialization, condition, and update, and learn continue and break to skip or exit iterations.
Learn to declare an integer array of five elements and iterate it with a for loop in Metatrader, practicing ascending and descending index orders and printing each value.
Explore functions, including function declaration, function definition, and function call, and practice calling five predefined functions to control program flow with the choice and loop operators.
Define a stop loss function in MQL5 with declaration and definition, returning double, and compute price-based stop loss from open price, trading direction, and stop loss points using point size.
Learn how to call a stop loss function in mql5, pass arguments like open price and bid price, and print the resulting stop loss.
Explore the Mql5 predefined functions, from common utilities like alert and print to array operations, conversions, math, strings, date/time, account and market info, and trading actions for expert advisors.
Experiment with functions in Mql5 by recreating a stop loss function, creating your own function, and using predefined functions like close and array print.
Explore expert advisors and trading systems by examining preprocessor directives, event handlers, and the workflow you will implement in this course, and preview the training system at course end.
Explore preprocessor directives in an MQL5 expert advisor template, including define constants, property directives, include and import directives, and conditional compilation.
Explore how MQL5 event handlers like OnInit, OnDeinit, and OnTick drive expert advisors, triggering code when attached or removed and with each new price tick to generate trading signals.
Initialize indicators and obtain their handles, check for errors, then the expert advisor processes new bars on tick events to detect patterns, generate signals, and execute trades.
this lesson presents a moving average trend-following system for an expert adviser, entering long when price closes above moving average and exiting below, with six-point stop loss and take profit.
Explore expert adviser general settings and bar opening controls, preprocessor directives, and how to structure code, set system inputs, and declare global variables.
Design an expert advisor in mql5 by outlining properties, inputs, globals, and functions, add an expert notes section and disclaimer, and structure code for readability and future trading logic.
Learn to configure expert advisor properties and external inputs, use a magic number to isolate each EA's trades, set moving average parameters, manage volume and risk, and implement global variables.
Learn to use event handlers and expert advisors in MQL5, attach to a chart, and open long or short trades when a bar closes above or below the moving average.
Learn to detect a new bar in mql5 by comparing the opening time of the current bar with a stored value, using the high time function, symbol, timeframe, and shift.
Code entry and exit signals for an expert advisor in mql5, using global variables to control bar opening, and apply metatrader five indicators, the moving average and the willing advance.
Access price data in MQL5 using the predefined close function or the MQL5 rates structure, set a series array, and retrieve bar open and close for entry signals.
Learn to normalize prices to a symbol’s required decimals in MQL5, using digits or tick size, to correctly place stop loss, take profit, and pending orders.
Create a function to access the open price in MQL5 by adapting the existing close price function, and verify it in MetaTrader with the new open price retrieval.
Create and initialize a moving average indicator in MQL5, set symbol, timeframe, period, shift, method, and applied price; implement error handling and store the handle for later use.
Create a function to retrieve moving average data using a handle and a shift. Copy the three most recent values into a series array and normalize to digits, with error logging.
Create a price and moving average entry signal in MQL5 by returning long or short based on bar one and bar two crosses, then open trades.
Learn to implement a multibuffer Bollinger bands indicator in MQL5, creating handles, filling upper, middle, and lower bands, and applying expert advisor trading logic with moving averages.
Learn to implement moving average exit signals in a mql5 expert adviser, coding exit long, exit short, or no exit functions and managing trade closures and sleep delays.
Begin placing orders to the market using price and indicator data, guided by the expert advisor's entry and exit signals to open new positions and close current ones.
Identify the four order execution types—instant, request, market, and exchange—and understand how price, deviation, and broker policy influence order placement.
Learn to place your first order in MQL5 by building a trade request and result, using bid/ask prices, magic numbers, and logging to execute market orders.
Explore how to specify filling policy in MQL5 order placement to avoid errors like 4756, using immediate or cancel settings, with practical steps for usd jpy trades.
Implement an order placement function in an mql5 expert advisor to open trades via entry signals long or short, using trade requests, and return order ticket while logging details.
Learn how to check placed positions in an expert adviser using MQL5, looping through positions to verify magic numbers and prevent new trades when a matching position exists.
Implement a close trade function in mql5 that verifies open positions, selects by magic number and type, sends a close order, and logs the action.
Explore position management in MQL5, including stop loss and take profit with calculated levels, and sending orders to set them, plus trailing stop loss and break-even for advanced control.
Implement a stop loss function in an MQL5 expert adviser, placing stop loss and take profit on entry, with fixed points or moving average logic for long and short trades.
Develop and test a take profit function in mql5 by mirroring the stop loss logic, using fixed points for long and short positions, with printouts for verification.
Modify an open trade in mql5 by sending a stop loss and take profit update with a modify order, including price normalization, retries, and testing in metatrader.
Implement a trailing stop loss in MQL5 by following price at a fixed distance in points, updating only when price moves in our favor. Leverage backtesting via strategy tester.
Learn to implement a break-even function in MQL5 that moves the stop loss to the open price after a defined distance, protecting profits for long and short positions.
Learn to enforce broker stop levels in an MQL5 expert advisor by creating an adjustable stop label function that converts levels to price and adjusts stop loss and take profit.
In this course, you will learn how to fully automate your trading using MetaTrader 5 trading robots (expert advisors). We will code an expert advisor from scratch that can trade in different financial markets, such as forex, cryptocurrencies, indices, commodities, and stocks.
The course is organized into 2 blocks and 12 sections.
BLOCK 1: MQL5 PROGRAMMING LANGUAGE
In section 1, we will review the MetaTrader 5 (MT5) platform and introduce the MQL5 programming language and its applications.
In sections 2 to 5, we will cover the fundamentals of the MQL5 language. In these sections, we will address all the basic features of the language, with plenty of examples and exercises closely related to trading.
This way, the course will offer you practical, engaging, and interesting content while being concise to fast-track you to the most exciting part, sections 6 to 12.
BLOCK 2: METATRADER 5 EXPERT ADVISOR CODING
This block begins with section 6, where we will introduce you to expert advisors and share a widely known trading system that has been extensively used in the past.
In sections 7 to 11, we will apply all the knowledge acquired in previous lessons to code a trading robot that automates a trading system and trades uninterrupted as long as the markets are open.
We will equip our expert advisor with a structure that serves as a framework for other projects, including triggers for entry and exit points.
Additionally, we will include basic aspects of position management, such as placing stop loss and take profit orders, as well as more advanced management like trailing stop loss and break-even.
Finally, in section 12, we will validate the system. To do this, we will subject the expert advisor to backtesting against historical data to ensure the code is correct.
Ultimately, we will deploy it in forex, stocks, indices, and commodities markets in a trading account. This will allow us to validate that the robot works both in a trading account and in simulation.
Now is the right time to learn algorithmic trading.
In today’s modern markets, the share of algorithmic trading in volume terms stands around 70-80 per cent, and there are several reasons for that:
Algorithmic trading allows you to trade as many strategies or markets as your computing power provides, overcoming human limitations that constrain manual traders.
Automating your strategies frees up time from repetitive screening of the markets that you can then allocate to research, leisure, or other activities. Furthermore, bots can trade 24/7 which mean they can trade any session, at any time and without rest, which is impossible to do for a single human.
Emotionless and error-free. Algorithms read patterns and apply pre-established coded rules without experiencing fear or any other emotions, which means that robots do not commit mistakes, programmers do.
Algorithmic trading will not only automate your trading, but also it is the first step to trade like a quant, which means that every decision you take will be backed by data and statistics that will be provided by your algorithms and this will increase your chances of success in the markets.
Backtesting and optimization is much faster and comprehensive through algorithms than through manual means with spreadsheets, which will allows you to know the performance of a strategy in the past and, again, increase your chances of success in the markets.
Are you passionate about trading?
Do you want to free-up time from monitoring screens?
Do you want to increase your chances of winning in the markets?
If the answer is "Yes", and you are ready to put in the hard work, you are ready to start your algorithmic trading journey today!
This course is backed by Udemy’s 30 day money back guarantee.
If you're not happy for any reason you will be refunded in full!
I am confident that you will find this is one of the best courses to learn algorithmic trading and it delivers sharing insights that you won’t find easily elsewhere.
I am excited to watch you take your first step in your algorithmic trading journey and I hope to see you inside!
The expert advisor will be provided to you at the end of the course.
- José Martínez