Join our fan page

MQL5 Programming for Traders – Source Codes from the Book. Part 2 - expert for MetaTrader 5
- Views:
- 5642
- Rating:
- Published:
- 2023.12.15 14:23
- Updated:
- 2023.12.15 16:00
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Part 2. Fundamentals of MQL5 programming
"Part 2. MQL5 programming fundamentals" is an introduction to the key concepts of this programming language. Like any other language, MQL5 is based on several fundamental concepts that serve as building blocks for creating complex programs. This part of the book is devoted to data types, identifiers, variables, expressions, and operators. You will learn how to combine different instructions to form the program logic.
The basic principles of procedural programming will enable readers to learn how to create programs that follow a sequence of steps to process data. This is an important step before proceeding to the powerful paradigm of object-oriented programming (OOP), which will be covered in the next part of the book.
Identifiers play a key role in MQL5 programming, as they allow program elements to be accessed by unique names. Identifiers are composed of Latin letters, numbers, and underscores, they cannot begin with a number and must not match MQL5 reserved words. Adhering to this important rule is a required prerequisite for successful program compilation.
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/45591

The first chapter of the book introduces the MQL5 language and development environment. One of the new features introduced in the MQL5 language compared to MQL4 (MetaTrader 4 language) is support for object-oriented programming (OOP), which makes it similar to C++.

Draw a Rectangle on chart to plot custom grids based on points value on input

Part 3 "Object Oriented Programming in MQL5" offers an immersion into the world of object-oriented programming (OOP) in the MQL5 language. Software development often involves the complexity related to the management of multiple entities, requiring advanced technology to improve programming convenience, productivity, and quality.

In the fourth part of the book, we will focus on mastering built-in functions (MQL5 API) and will gradually delve into specialized subsystems. Any MQL5 program can utilize a plethora of technologies and functionalities. Therefore, it makes sense to begin with the most simple and useful functions that can be utilized in most programs.