Presenting the book "MQL5 Programming for Traders"

 

We have released the most comprehensive guide to MQL5 programming, authored by experienced algorithmic trader Stanislav Korotky with MetaQuotes' support.

The book is intended for programmers of all levels. Beginners will learn the fundamentals as the book introduces key development tools and basic programming concepts. With this material, you can create, compile, and run your first application in the MetaTrader 5 trading platform. Users with experience in other programming languages can immediately advance to the applied part related to creating trading robots and analytical applications in MQL5.

Presenting the book "MQL5 Programming for Traders"

The book is freely available online, under the "Book" section of the MQL5.community website. It consists of seven parts:

  1. Introduction to MQL5 and development environment – an overview of the basic principles of MQL5 programming and the MQL5 development environment, including MetaEditor's editing and compiling features.
  2. Fundamentals of MQL5 programming – the basic concepts, including data types, instructions, operators, expressions, variables, code blocks, and program structures applied for procedural-style MQL5 program development.
  3. Object-oriented programming – distinctive features that set MQL5 apart despite its similarities with other languages supporting the OOP paradigm, especially with C++.
  4. Common functions – frequently used built-in functions that are applicable in any program.
  5. Creating application programs – an in-depth look at the architectural nuances of MQL5 programs and their specialization by types of trading-related tasks, such as technical analysis using indicators, chart management, and use of graphical objects, among others.
  6. Trading automation – how to analyze the trading environment and automate trading using robots.
  7. Advanced language tools – a set of specialized APIs aimed at facilitating MQL5 integration with related technologies, including databases, data exchange, OpenCL, and Python.

The book provides numerous source code examples. Following the explanation, you can implement your own applications in the built-in editor and instantly view program execution results in the platform. The source codes are available in the public project \MQL5\Shared Projects\MQL5Book and in the Code Base.

Start learning MQL5 right now and discover the world of professional algorithmic trading. The knowledge gained will help you bring your ideas to life. You can also apply them in a commercial environment by developing and selling applications through the Market and taking on programming orders in the Freelance.


Read the Book
 

Can I download this book as pdf file?

Sincerely

Matthias Hammelsbeck

 
Dr Matthias Hammelsbeck #:

Can I download this book as pdf file?

Probably a bit later

 
Many thanks to Stanislav Korotky and MetaQuotes for this (fantastic) free book!
 
Hi,
In the meantime I read many chapters of the book and I 'm completely excited! I gained a lot more understanding of many topics where I had some difficulties to grasp.
I would like to say THANK YOU to the author. You did a work that was long overdue. Fantastic. 
Matthias 
 
Wow, honestly this is amazing, thanks!
Can I make a provisorical comprehensive table of contents (with hyperlinks) for our beginners group? Would that be illegal reproduction? Just want to be sure. If you like I can share it here.
Happy New Year to All!
 

Here is a complete table of contents, it is basically a collection of all the links so you will directly get to the book topics on mql5.com. You can expand and collapse the chapters and subchapters.

Files:
 

Hi,

very good book, very helpful. 

Nevertheless I have one question: in chapter "Increment and decrement" you write:

Postfix form may be useful for more compact writing of expressions combining a reference to the preceding value of the operand and its side modification (two separate statements would be required to make an alternative record of the same). In all other cases, it is recommended to use the prefix form (it does not create a temporary copy of the "old" value).


But in some header files in MQL5/Include/MQL5Book you are using the postfix form in for - loops and not the prefix form:

AutoIndicator.mqh:      for(int i = 0; i < pnum; i++)
AutoIndicator.mqh:      for(int i = 0; i < n; i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(orders); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(deals); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(orders); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(deals); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(positions); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(positions); i++)
CustomTrade.mqh:   for(int i = 0; i < ArraySize(positions); i++)
EnumToArray.mqh:   for(int i = start; i < stop && !IsStopped(); i++)
IndBufArray.mqh:      for(int i = 0; i < ArraySize(array); i++)
MarginProfitMeter.mqh:      for(int i = 0; i < SymbolsTotal(true); i++)
MultiSymbolMonitor.mqh:      for(int i = 0; i < lastTime.getSize(); i++)
MultiSymbolMonitor.mqh:      for(int i = 0; i < lastTime.getSize(); i++)
MultiSymbolMonitor.mqh:      for(int i = 0; i < lastTime.getSize(); i++)
MultiSymbolMonitor.mqh:      for(int i = 1; i < lastTime.getSize(); i++)
OutputStream.mqh:      for(int i = 0; i < n; i++)
QuickSortStructT.mqh:         for(int i = start; i <= end; i++)
QuickSortT.mqh:         for(int i = start; i <= end; i++)
QuickSortTm.mqh:         for(int i = start; i <= end; i++)
Tableau.mqh:      for(int i = 0; i < nrows; i++)
Tableau.mqh:      for(int i = 0; i < n; i++)
Tableau.mqh:      for(int i = 0; i < ncols; i++)
Tableau.mqh:      for(int i = 0; i < n; i++)
TickFilter.mqh:      for(int i = 2; i < size; i++)
TickFilter.mqh:      for(int i = 0; i < size; i++)
TickFilter.mqh:      for(int i = 1; i < size - 2; i++)
TradeReport.mqh:      for(int i = 1; i < limit; i++)
TradeReport.mqh:      for(int i = 0; i < n - 1; i++)
URL.mqh:      for(int i = 0; i < len; i++)
URL.mqh:      for(int i = 0; i < len; i++)
URL.mqh:      for(int i = 0; i < URL_PARTS::URL_ENUM_LENGTH; i++)

Why not the prefix form? I do not understand.

Matthias

 

There are no difference between forms.

 
MetaQuotes #:

There are no difference between forms.

Ok. But why do you recommend using the prefix form? Performance reasons?

 
Dr Matthias Hammelsbeck #:

Ok. But why do you recommend using the prefix form? Performance reasons?

Author recommends useless ideas from 1990.

MQL5 compiler extremely efficient and most of the old tricks absolutely useless now.
Reason: