Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

MQL5 Programming for Traders – Source Codes from the Book. Part 4 - expert for MetaTrader 5

Views:
2463
Rating:
(4)
Published:
2023.12.15 14:51
Updated:
2024.03.11 14:34
\MQL5\Files\MQL5Book\
ansi1252.txt (0.05 KB) view
clock10.htm (0.96 KB)
clock10.png (0.32 KB)
envrun.bat (0.05 KB)
icons-322-46.bmp (57.91 KB)
unicode1.txt (0.1 KB) view
unicode2.txt (0.1 KB) view
unicode3.txt (0.1 KB) view
utf8.txt (0.05 KB) view
\MQL5\Include\MQL5Book\
AppliedTo.mqh (1.17 KB) view
ArrayUtils.mqh (4.19 KB) view
AutoIndicator.mqh (11.07 KB) view
AutoPtr.mqh (1.87 KB) view
CalendarCache.mqh (24.24 KB) view
ColorMix.mqh (6.25 KB) view
Comments.mqh (3.71 KB) view
ConverterT.mqh (0.96 KB) view
CRC32.mqh (1.89 KB) view
CustomOrder.mqh (8.69 KB) view
CustomTrade.mqh (39.4 KB) view
DateTime.mqh (2.56 KB) view
DBSQLite.mqh (24.03 KB) view
DealFilter.mqh (0.84 KB) view
DealMonitor.mqh (4.56 KB) view
Defines.mqh (0.71 KB) view
EnumToArray.mqh (1.54 KB) view
FileHandle.mqh (1.97 KB) view
FileHolder.mqh (3.64 KB) view
HTTPHeader.mqh (3.18 KB) view
HTTPRequest.mqh (2.54 KB) view
IndBufArray.mqh (7.17 KB) view
IndCommon.mqh (0.9 KB) view
IS.mqh (0.98 KB) view
LibRand.mqh (1.23 KB) view
MapArray.mqh (2.64 KB) view
MqlError.mqh (8.53 KB) view
MqlTradeSync.mqh (35.33 KB) view
MultiTimer.mqh (6.77 KB) view
ObjectMonitor.mqh (10.68 KB) view
OptReader.mqh (21.93 KB) view
OrderFilter.mqh (1.19 KB) view
Periods.mqh (1.95 KB) view
Permissions.mqh (4.87 KB) view
PNG.mqh (5.31 KB) view
PRTF.mqh (1.07 KB) view
QuickSortT.mqh (1.67 KB) view
QuickSortTm.mqh (2.43 KB) view
Reservoir.mqh (4.71 KB) view
RSquared.mqh (2.27 KB) view
RTTI.mqh (1.57 KB) view
StringUtils.mqh (1.91 KB) view
StructPrint.mqh (0.85 KB) view
Tableau.mqh (8.79 KB) view
TickEnum.mqh (2.4 KB) view
TickFilter.mqh (3.74 KB) view
TickModel.mqh (2.67 KB) view
Timing.mqh (1.71 KB) view
toyjson.mqh (11.4 KB) view
TplFile.mqh (8.12 KB) view
TplFileFull.mqh (11.01 KB) view
TradeCache.mqh (7.55 KB) view
TradeFilter.mqh (10.59 KB) view
TradeGuard.mqh (4.42 KB) view
TradeReport.mqh (8.83 KB) view
TradeReportSVG.htm (0.38 KB)
TradeState.mqh (5.91 KB) view
TradeUtils.mqh (11.51 KB) view
Tuples.mqh (4.94 KB) view
Uninit.mqh (1.16 KB) view
URL.mqh (4.64 KB) view
Warnings.mqh (0.54 KB) view
\MQL5\Include\MQL5Book\ws\
wsclient.mqh (5.19 KB) view
wsframe.mqh (11.62 KB) view
wsmessage.mqh (5.44 KB) view
wsprotocol.mqh (15.63 KB) view
wstools.mqh (6.22 KB) view
wstransport.mqh (5.33 KB) view
\MQL5\Libraries\MQL5Book\
LibRand.mq5 (3 KB) view
\MQL5\Presets\MQL5Book\
BandOsMA.set (1.22 KB)
BandOsMACustom.set (1.54 KB)
BandOsMAticks.set (1.24 KB)
\MQL5\Scripts\MQL5Book\p4\
ArrayCopy.mq5 (5.47 KB) view
ArrayFill.mq5 (2.15 KB) view
ArrayInsert.mq5 (2.34 KB) view
ArrayMaxMin.mq5 (1.64 KB) view
ArrayPrint.mq5 (3.19 KB) view
ArrayRemove.mq5 (2.63 KB) view
ArraySearch.mq5 (3.29 KB) view
ArraySize.mq5 (1.35 KB) view
ArraySort.mq5 (2.94 KB) view
ArrayWorker.mq5 (5.79 KB) view
Complex.mq5 (1.19 KB) view
EnvClose.mq5 (0.88 KB) view
EnvError.mq5 (2.76 KB) view
Environment.mq5 (3.52 KB) view
EnvKeys.mq5 (1.01 KB) view
EnvMode.mq5 (1.29 KB) view
EnvScreen.mq5 (1.64 KB) view
EnvStop.mq5 (1.48 KB) view
FileArray.mq5 (4.44 KB) view
FileAtomic.mq5 (7.77 KB) view
FileCopy.mq5 (2.31 KB) view
FileCursor.mq5 (7.13 KB) view
FileExist.mq5 (1.46 KB) view
FileFind.mq5 (2.31 KB) view
FileFlush.mq5 (3.69 KB) view
FileFolder.mq5 (1.84 KB) view
FileHandle.mq5 (1.87 KB) view
FileHolder.mq5 (3.39 KB) view
FileSelect.mq5 (3.57 KB) view
FileStruct.mq5 (4.78 KB) view
FileText.mq5 (2.67 KB) view
FileTxtCsv.mq5 (4.9 KB) view
GlobalsList.mq5 (1.35 KB) view
MathAbs.mq5 (1.59 KB) view
MathExp.mq5 (1.52 KB) view
MathHyper.mq5 (1.1 KB) view
MathInvalid.mq5 (2.95 KB) view
MathMaxMin.mq5 (1.06 KB) view
MathMod.mq5 (1 KB) view
MathPlot.mq5 (3.94 KB) view
MathPowSqrt.mq5 (0.93 KB) view
MathRand.mq5 (1.29 KB) view
MathRound.mq5 (1.12 KB) view
MathSwap.mq5 (1.49 KB) view
MathTrig.mq5 (1.18 KB) view
Matrix.mqh (10.18 KB) view
MatrixSVD.mq5 (2.5 KB) view
OutputSound.mq5 (1.27 KB) view
PRTF.mqh (0.99 KB) view
StringAdd.mq5 (3.4 KB) view
StringInit.mq5 (2.4 KB) view
TimeCheck.mq5 (3.45 KB) view
TimeCount.mq5 (0.99 KB) view
TimeSummer.mq5 (5.12 KB) view
ZeroMemory.mq5 (5.25 KB) view
\MQL5\Services\MQL5Book\p4\
EnvType.mq5 (0.91 KB) view
PRTF.mqh (1.07 KB) view
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Part 4. Common MQL5 APIs

In the previous sections of the book, we delved into the basics of the MQL5 programming language and studied its syntax, rules of use, and key concepts. However, to write real-life programs employing data processing and automated trading, you should use many built-in functions to interact with the MetaTrader 5 terminal.

In "Part 4. Common MQL5 APIs", 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.

Among the primary topics, we will study array operations, string processing, file interactions, data conversion, and user interaction functions. We will also explore mathematical functions and program environment management.

Built-in MQL5 functions

Unlike some other programming languages, using the built-in functions of the MQL5 API does not require additional preprocessor directives. The names of all MQL5 API functions are available in the global context (namespace) and can always be accessed unconditionally.

We will also discuss the possibility of using similar names in different program contexts, such as class method names or custom namespaces. In such cases, you should use the context resolution operator to call the global function, which we discussed in the section on nested types, namespaces, and the context operator '::'.

Programming often requires operations with various data types. In previous sections, we have already seen the mechanisms for explicit and implicit conversion of built-in data types. However, they may not always be suitable for different reasons. To provide more fine-tuned data conversion between different types, the MQL5 API includes a set of conversion functions. Particular attention is paid to functions for conversions between strings and other types, such as numbers, dates and times, colors, structures, and enumerations.


Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/45593

MQL5 Programming for Traders – Source Codes from the Book. Part 3 MQL5 Programming for Traders – Source Codes from the Book. Part 3

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.

MQL5 Programming for Traders – Source Codes from the Book. Part 2 MQL5 Programming for Traders – Source Codes from the Book. Part 2

Part 2 "MQL5 programming fundamentals" is an introduction to the key concepts of this programming language. 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.

MQL5 Programming for Traders – Source Codes from the Book. Part 5 MQL5 Programming for Traders – Source Codes from the Book. Part 5

In Part 5 of the book, we'll delve deeper into the APIs associated with algorithmic trading, including financial data analysis and processing, chart visualization, automation, and user interactions.

MQL5 Programming for Traders – Source Codes from the Book. Part 6 MQL5 Programming for Traders – Source Codes from the Book. Part 6

In Part 6 of the "MQL5 Programming for Traders", we will study a key component of the MQL5 language – trading automation. We will start with a description of the fundamental entities, such as financial instrument specifications and trading account settings. These are prerequisites for creating properly operating Expert Advisors.