MQL5 Programming for Traders
معرفی کتاب «MQL5 Programming for Traders» نوشتهٔ Stanislav Korotky، منتشرشده توسط نشر Metaquotes در سال 2024. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «MQL5 Programming for Traders» در دستهٔ بدون دستهبندی قرار دارد.
Modern trading relies heavily on computer technology. Automation now extends beyond the boundaries of exchanges and brokerage offices, becoming accessible to everyday users through specialized software solutions. Among the pioneers in this field stands MetaTrader, which emerged in the early 2000s. The latest platform version, MetaTrader 5, remains at the forefront, continuously evolving with innovative features and functionalities. A key element continuously refined within MetaTrader 5 is its built-in programming language MQL5. It enables traders to ascend to a whole new level of trading automation, commonly referred to as Algorithmic Trading. With MQL5, traders can transform their strategies into applications by writing their own indicators for analysis, scripts for executing operations, or Expert Advisor for complete trading automation. Being an automated trading system, an Expert Advisor can operate autonomously, tracking price changes and promptly alerting traders via email or SMS. The built-in programming language allows traders to implement virtually any trading concept, from simple strategies to complex algorithms based on neural networks. MQL5 seamlessly combines the features of domain-specific and universal programming languages. Over the years, the language has acquired valuable advancements, such as support for 3D graphics, parallel computations via OpenCL, Python integration, and SQLite database support. To unlock the full potential of MetaTrader 5, you must delve into programming. This book will help you master MQL5 and learn how to create your own trading applications. It is assumed that the reader is already familiar with MetaTrader 5. Another prerequisite is the understanding of the fundamental principles of terminal operation within a distributed information system that facilitates trading. The terminal Help provides detailed information on all available features. Furthermore, using MQL5 API, traders can access capabilities far beyond the MetaTrader 5 GUI. Master the programming language to implement complex scenarios, automating various terminal operation aspects and enhancing trading strategy efficiency. The book is divided into 7 parts, each focusing on different aspects of MQL5 programming. Part 1 introduces basic MQL5 programming principles and MetaEditor, the standard MQL5 framework. Users experienced in programming in other languages should note the features of the framework. Part 2 explains the basic terms, such as types, instructions, operators, expressions, variables, code blocks, program structures. It describes how these terms are utilized in MQL5 procedural programming style. Those users who know MQL4 well can skip this part and start reading Part 3. Part 3 deals with object oriented programming (OOP) in MQL5. Despite its similarity to other languages that support the OOP paradigm (especially to C++), MQL5 has certain specific features. To taste, MQL5 is sort of C±±. Part 4 describes common embedded functions which are applicable to in any program. Part 5 covers the architectural features of MQL programs and their "majoring" in types to perform various trading tasks, such as technical analysis using indicators, chart management and marking the charts with imposing graphical objects onto them, and responses to interactive actions and events involving MQL programs. Part 6 explains how to analyze trading environment and automate trading operations using robots. This part also presents the program interaction with tester in various modes, including strategy optimization. Part 7 contains information regarding the extended set of dedicated APIs facilitating the MQL5 integration with adjacent technologies, such as databases, network data exchange, OpenCL, Python, etc. Throughout the book, the material is presented in a balanced manner, combining common approaches, examples, and technical details. The reader is guided through transitioning from one concept to another, resembling a chicken-and-egg problem inherent in learning programming. To reinforce understanding, most MQL programs discussed in the book are available as source codes for practical exploration in MetaEditor/MetaTrader 5. MQL5 Programming for Traders Part 1. Introduction to MQL5 and development environment 1.1 Editing, compiling, and running programs 1.2 MQL Wizard and program draft 1.3 Statements, code blocks, and functions 1.4 First program 1.5 Data types and values 1.6 Variables and identifiers 1.7 Assignment and initialization, expressions and arrays 1.8 Data input 1.9 Error fixing and debugging 1.10 Data output 1.11 Formatting, indentation, and spaces 1.12 Mini summary Part 2. Programming fundamentals 2.1 Identifiers 2.2 Built-in data types 2.2.1 Integers 2.2.2 Floating-point numbers 2.2.3 Character types 2.2.4 String type 2.2.5 Logic (Boolean) type 2.2.6 Date and time 2.2.7 Color 2.2.8 Enumerations 2.2.9 Custom enumerations 2.2.10 Void type 2.3 Variables 2.3.1 Declaration and definition of variables 2.3.2 Context, scope, and lifetime of variables 2.3.3 Initialization 2.3.4 Static variables 2.3.5 Constant variables 2.3.6 Input variables 2.3.7 External variables 2.4 Arrays 2.4.1 Array characteristics 2.4.2 Description of arrays 2.4.3 Using arrays 2.5 Expressions 2.5.1 Basic concepts 2.5.2 Assignment operation 2.5.3 Arithmetic operations 2.5.4 Increment and decrement 2.5.5 Comparison operations 2.5.6 Logical operations 2.5.7 Bitwise operations 2.5.8 Modification operations 2.5.9 Conditional ternary operator 2.5.10 Comma 2.5.11 Special operators sizeof and typename 2.5.12 Grouping with parentheses 2.5.13 Priorities of operations 2.6 Type conversion 2.6.1. Implicit type conversion 2.6.2. Arithmetic type conversions 2.6.3. Explicit type conversion 2.7 Statements 2.7.1 Compound statements (blocks of code) 2.7.2 Declaration/definition statements 2.7.3 Simple statements (expressions) 2.7.4 Overview of control statements 2.7.5 For loop 2.7.6 While loop 2.7.7 Do loop 2.7.8 If selection 2.7.9 Switch selection 2.7.10 Break jump 2.7.11 Continue jump 2.7.12 Return jump 2.7.13 Empty statement 2.8 Functions 2.8.1 Function definition 2.8.2 Function call 2.8.3 Parameters and arguments 2.8.4 Value parameters and reference parameters 2.8.5 Optional parameters 2.8.6 Return values 2.8.7 Function declaration 2.8.8 Recursion 2.8.9 Function overloading 2.8.10 Function pointers (typedef) 2.8.11 Inlining 2.9 Preprocessor 2.9.1 Including source files (#include) 2.9.2 Overview of macro substitution directives 2.9.3 Simple form of #define 2.9.4 Form of #define as a pseudo-function 2.9.5 Special operators '#' and '##' inside #define definitions 2.9.6 Cancelling macro substitution (#undef) 2.9.7 Predefined preprocessor constants 2.9.8 Conditional compilation (#ifdef/#ifndef/#else/#endif) 2.9.9 General program properties (#property) Part 3. Object Oriented Programming 3.1 Structures and unions 3.1.1 Definition of structures 3.1.2 Functions (methods) in structures 3.1.3 Copying structures 3.1.4 Constructors and destructors 3.1.5 Packing structures in memory and interacting with DLLs 3.1.6 Structure layout and inheritance 3.1.7 Access rights 3.1.8 Unions 3.2 Classes and interfaces 3.2.1 OOP fundamentals: Abstraction 3.2.2 OOP fundamentals: Encapsulation 3.2.3 OOP fundamentals: Inheritance 3.2.4 OOP fundamentals: Polymorphism 3.2.5 OOP fundamentals: Composition (design) 3.2.6 Class definition 3.2.7 Access rights 3.2.8 Constructors: default, parametric, and copying 3.2.9 Destructors 3.2.10 Self-reference: this 3.2.11 Inheritance 3.2.12 Dynamic creation of objects: new and delete 3.2.13 Pointers 3.2.14 Virtual methods (virtual and override) 3.2.15 Static members 3.2.16 Nested types, namespaces, and the context operator '::' 3.2.17 Splitting class declaration and definition 3.2.18 Abstract classes and interfaces 3.2.19 Operator overloading 3.2.20 Object type сasting: dynamic_cast and pointer void * 3.2.21 Pointers, references, and const 3.2.22 Inheritance management: final and delete 3.3 Templates 3.3.1 Template header 3.3.2 General template operation principles 3.3.3 Templates vs preprocessor macros 3.3.4 Features of built-in and object types in templates 3.3.5 Function templates 3.3.6 Object type templates 3.3.7 Method templates 3.3.8 Nested templates 3.3.9 Absent template specialization Part 4. Common APIs 4.1 Built-in type conversions 4.1.1 Numbers to strings and vice versa 4.1.2 Normalization of doubles 4.1.3 Date and time 4.1.4 Color 4.1.5 Structures 4.1.6 Enumerations 4.1.7 Type complex 4.2 Working with strings and symbols 4.2.1 Initialization and measurement of strings 4.2.2 String concatenation 4.2.3 String comparison 4.2.4 Changing the character case and trimming spaces 4.2.5 Finding, replacing, and extracting string fragments 4.2.6 Working with symbols and code pages 4.2.7 Universal formatted data output to a string 4.3 Working with arrays 4.3.1 Logging arrays 4.3.2 Dynamic arrays 4.3.3 Array measurement 4.3.4 Initializing and populating arrays 4.3.5 Copying and editing arrays 4.3.6 Moving (swapping) arrays 4.3.7 Comparing, sorting, and searching in arrays 4.3.8 Timeseries indexing direction in arrays 4.3.9 Zeroing objects and arrays 4.4 Mathematical functions 4.4.1 The absolute value of a number 4.4.2 Maximum and minimum of two numbers 4.4.3 Rounding functions 4.4.4 Remainder after division (Modulo operation) 4.4.5 Powers and roots 4.4.6 Exponential and logarithmic functions 4.4.7 Trigonometric functions 4.4.8 Hyperbolic functions 4.4.9 Normality test for real numbers 4.4.10 Random number generation 4.4.11 Endianness control in integers 4.5 Working with files 4.5.1 Information storage methods: text and binary 4.5.2 Writing and reading files in simplified mode 4.5.3 Opening and closing files 4.5.4 Managing file descriptors 4.5.5 Selecting an encoding for text mode 4.5.6 Writing and reading arrays 4.5.7 Writing and reading structures (binary files) 4.5.8 Writing and reading variables (binary files) 4.5.9 Writing and reading variables (text files) 4.5.10 Managing position in a file 4.5.11 Getting file properties 4.5.12 Force write cache to disk 4.5.13 Deleting a file and checking if it exists 4.5.14 Copying and moving files 4.5.15 Searching for files and folders 4.5.16 Working with folders 4.5.17 File or folder selection dialog 4.6 Client terminal global variables 4.6.1 Writing and reading global variables 4.6.2 Checking the existence and last activity time 4.6.3 Getting a list of global variables 4.6.4 Deleting global variables 4.6.5 Temporary global variables 4.6.6 Synchronizing programs using global variables 4.6.7 Flushing global variables to disk 4.7 Functions for working with time 4.7.1 Local and server time 4.7.2 Daylight saving time (local) 4.7.3 Universal Time 4.7.4 Pausing a program 4.7.5 Time interval counters 4.8 User interaction 4.8.1 Logging messages 4.8.2 Alerts 4.8.3 Displaying messages in the chart window 4.8.4 Message dialog box 4.8.5 Sound alerts 4.9 MQL program execution environment 4.9.1 Getting a general list of terminal and program properties 4.9.2 Terminal build number 4.9.3 Program type and license 4.9.4 Terminal and program operating modes 4.9.5 Permissions 4.9.6 Checking network connections 4.9.7 Computing resources: memory, disk, and CPU 4.9.8 Screen specifications 4.9.9 Terminal and program string properties 4.9.10 Custom properties: Bar limit and interface language 4.9.11 Binding a program to runtime properties 4.9.12 Checking keyboard status 4.9.13 Checking the MQL program status and reason for termination 4.9.14 Programmatically closing the terminal and setting a return code 4.9.15 Handling runtime errors 4.9.16 User-defined errors 4.9.17 Debug management 4.9.18 Predefined variables 4.9.19 Predefined constants of the MQL5 language 4.10 Matrices and vectors 4.10.1 Types of matrices and vectors 4.10.2 Creating and initializing matrices and vectors 4.10.3 Copying matrices, vectors, and arrays 4.10.4 Copying timeseries to matrices and vectors 4.10.5 Copying tick history to matrices and vectors 4.10.6 Evaluation of expressions with matrices and vectors 4.10.7 Manipulating matrices and vectors 4.10.8 Products of matrices and vectors 4.10.9 Transformations (decomposition) of matrices 4.10.10 Obtaining statistics 4.10.11 Characteristics of matrices and vectors 4.10.12 Solving equations 4.10.13 Machine learning methods Part 5. Creating application programs 5.1 General principles for executing MQL programs 5.1.1 Designing MQL programs of various types 5.1.2 Threads 5.1.3 Overview of event handling functions 5.1.4 Features of starting and stopping programs of various types 5.1.5 Reference events of indicators and Expert Advisors: OnInit and OnDeinit 5.1.6 The main function of scripts and services: OnStart 5.1.7 Programmatic removal of Expert Advisors and scripts: ExpertRemove 5.2 Scripts and services 5.2.1 Scripts 5.2.2 Services 5.2.3 Restrictions for scripts and services 5.3 Timeseries 5.3.1 Symbols and timeframes 5.3.2 Technical aspects of timeseries organization and storage 5.3.3 Getting characteristics of price arrays 5.3.4 Number of available bars (Bars/iBars) 5.3.5 Search bar index by time (iBarShift) 5.3.6 Overview of Copy functions for obtaining arrays of quotes 5.3.7 Getting quotes as an array of MqlRates structures 5.3.8 Separate request for arrays of prices, volumes, spreads, time 5.3.9 Reading price, volume, spread, and time by bar index 5.3.10 Finding the maximum and minimum values in a timeseries 5.3.11 Working with real tick arrays in MqlTick structures 5.4 Creating custom indicators 5.4.1 Main characteristics of indicators 5.4.2 Main indicator event: OnCalculate 5.4.3 Two types of indicators: for main window and subwindow 5.4.4 Setting the number of buffers and graphic plots 5.4.5 Assigning an array as a buffer: SetIndexBuffer 5.4.6 Plot settings: PlotIndexSetInteger 5.4.7 Buffer and chart mapping rules 5.4.8 Applying directives to customize plots 5.4.9 Setting plot names 5.4.10 Visualizing data gaps (empty elements) 5.4.11 Indicators in separate subwindows: sizes and levels 5.4.12 General properties of indicators: title and value accuracy 5.4.13 Item-wise chart coloring 5.4.14 Skip drawing on initial bars 5.4.15 Waiting for data and managing visibility (DRAW_NONE) 5.4.16 Multicurrency and multitimeframe indicators 5.4.17 Tracking bar formation 5.4.18 Testing indicators 5.4.19 Limitations and advantages of indicators 5.4.20 Creating an indicator draft in the MQL Wizard 5.5 Using ready-made indicators from MQL programs 5.5.1 Handles and counters of indicator owners 5.5.2 A simple way to create indicator instances: iCustom 5.5.3 Checking the number of calculated bars: BarsCalculated 5.5.4 Getting timeseries data from an indicator: CopyBuffer 5.5.5 Support for multiple symbols and timeframes 5.5.6 Overview of built-in indicators 5.5.7 Using built-in indicators 5.5.8 Advanced way to create indicators: IndicatorCreate 5.5.9 Flexible creation of indicators with IndicatorCreate 5.5.10 Overview of functions managing indicators on the chart 5.5.11 Combining output to main and auxiliary windows 5.5.12 Reading data from charts that have a shift 5.5.13 Deleting indicator instances: IndicatorRelease 5.5.14 Getting indicator settings by its handle 5.5.15 Defining data source for an indicator 5.6 Working with timer 5.6.1 Turning timer on and off 5.6.2 Timer event: OnTimer 5.6.3 High-precision timer: EventSetMillisecondTimer 5.7 Working with charts 5.7.1 Functions for getting the basic properties of the current chart 5.7.2 Chart identification 5.7.3 Getting the list of charts 5.7.4 Getting the symbol and timeframe of an arbitrary chart 5.7.5 Overview of functions for working with the complete set of properties 5.7.6 Descriptive chart properties 5.7.7 Checking the status of the main window 5.7.8 Getting the number and visibility of windows/subwindows 5.7.9 Chart display modes 5.7.10 Managing the visibility of chart elements 5.7.11 Horizontal shifts 5.7.12 Horizontal scale (by time) 5.7.13 Vertical scale (by price and indicator readings) 5.7.14 Colors 5.7.15 Mouse and keyboard control 5.7.16 Undocking chart window 5.7.17 Getting MQL program drop coordinates on a chart 5.7.18 Translation of screen coordinates to time/price and vice versa 5.7.19 Scrolling charts along the time axis 5.7.20 Chart redraw request 5.7.21 Switching symbol and timeframe 5.7.22 Managing indicators on the chart 5.7.23 Opening and closing charts 5.7.24 Working with tpl chart templates 5.7.25 Saving a chart image 5.8 Graphical objects 5.8.1 Object types and features of specifying their coordinates 5.8.2 Time and price bound objects 5.8.3 Objects bound to screen coordinates 5.8.4 Creating objects 5.8.5 Deleting objects 5.8.6 Finding objects 5.8.7 Overview of object property access functions 5.8.8 Main object properties 5.8.9 Price and time coordinates 5.8.10 Anchor window corner and screen coordinates 5.8.11 Defining anchor point on the object 5.8.12 Managing the object state 5.8.13 Priority of objects (Z-Order) 5.8.14 Object display settings: color, style, and frame 5.8.15 Font settings 5.8.16 Rotating text at an arbitrary angle 5.8.17 Determining object width and height 5.8.18 Visibility of objects in the context of timeframes 5.8.19 Assigning a character code to a label 5.8.20 Ray properties for objects with straight lines 5.8.21 Managing object pressed state 5.8.22 Adjusting images in bitmap objects 5.8.23 Cropping (outputting part) of an image 5.8.24 Input field properties: alignment and read-only 5.8.25 Standard deviation channel width 5.8.26 Setting levels in level objects 5.8.27 Additional properties of Gann, Fibonacci, and Elliot objects 5.8.28 Chart object 5.8.29 Moving objects 5.8.30 Getting time or price at the specified line points 5.9 Interactive events on charts 5.9.1 Event handling function OnChartEvent 5.9.2 Event-related chart properties 5.9.3 Chart change event 5.9.4 Keyboard events 5.9.5 Mouse events 5.9.6 Graphical object events 5.9.7 Generation of custom events Part 6. Trading automation 6.1 Financial instruments and Market Watch 6.1.1 Getting available symbols and Market Watch lists 6.1.2 Editing the Market Watch list 6.1.3 Checking if a symbol exists 6.1.4 Checking the symbol data relevance 6.1.5 Getting the last tick of a symbol 6.1.6 Schedules of trading and quoting sessions 6.1.7 Symbol margin rates 6.1.8 Overview of functions for getting symbol properties 6.1.9 Checking symbol status 6.1.10 Price type for building symbol charts 6.1.11 Base, quote, and margin currencies of the instrument 6.1.12 Price representation accuracy and change steps 6.1.13 Permitted volumes of trading operations 6.1.14 Trading permission 6.1.15 Symbol trading conditions and order execution modes 6.1.16 Margin requirements 6.1.17 Pending order expiration rules 6.1.18 Spreads and order distance from the current price 6.1.19 Getting swap sizes 6.1.20 Current market information (tick) 6.1.21 Descriptive symbol properties 6.1.22 Depth of Market 6.1.23 Custom symbol properties 6.1.24 Specific properties (stock exchange, derivatives, bonds) 6.2 Depth of Market 6.2.1 Managing subscriptions to Depth of Market events 6.2.2 Receiving events about changes in the Depth of Market 6.2.3 Reading the current Depth of Market data 6.2.4 Using Depth of Market data in applied algorithms 6.3 Trading account information 6.3.1 Overview of functions for getting account properties 6.3.2 Identifying the account, client, server, and broker 6.3.3 Account type: real, demo or contest 6.3.4 Account currency 6.3.5 Account type: netting or hedging 6.3.6 Restrictions and permissions for account operations 6.3.7 Account margin settings 6.3.8 Current financial performance of the account 6.4 Creating Expert Advisors 6.4.1 Expert Advisors main event: OnTick 6.4.2 Basic principles and concepts: order, deal, and position 6.4.3 Types of trading operations 6.4.4 Order types 6.4.5 Order execution modes by price and volume 6.4.6 Pending order expiration dates 6.4.7 Margin calculation for a future order: OrderCalcMargin 6.4.8 Estimating the profit of a trading operation: OrderCalcProfit 6.4.9 MqlTradeRequest structure 6.4.10 MqlTradeCheckResult structure 6.4.11 Request validation: OrderCheck 6.4.12 Request sending result: MqlTradeResult structure 6.4.13 Sending a trade request: OrderSend and OrderSendAsync 6.4.14 Buying and selling operations 6.4.15 Modying Stop Loss and/or Take Profit levels of a position 6.4.16 Trailing stop 6.4.17 Closing a position: full and partial 6.4.18 Closing opposite positions: fill and partial 6.4.19 Placing a pending order 6.4.20 Modifying a pending order 6.4.21 Deleting a pending order 6.4.22 Getting a list of active orders 6.4.23 Order properties (active and historical) 6.4.24 Functions for reading properties of active orders 6.4.25 Selecting orders by properties 6.4.26 Getting the list of positions 6.4.27 Position properties 6.4.28 Functions for reading position properties 6.4.29 Deal properties 6.4.30 Selecting orders and deals from history 6.4.31 Functions for reading order properties from history 6.4.32 Functions for reading deal properties from history 6.4.33 Types of trading transactions 6.4.34 OnTradeTransaction event 6.4.35 Synchronous and asynchronous requests 6.4.36 OnTrade event 6.4.37 Monitoring trading environment changes 6.4.38 Creating multi-symbol Expert Advisors 6.4.39 Limitations and benefits of Expert Advisors 6.4.40 Creating Expert Advisors in the MQL Wizard 6.5 Testing and optimization of Expert Advisors 6.5.1 Generating ticks in tester 6.5.2 Time management in the tester: timer, Sleep, GMT 6.5.3 Testing visualization: chart, objects, indicators 6.5.4 Multicurrency testing 6.5.5 Optimization criteria 6.5.6 Getting testing financial statistics: TesterStatistics 6.5.7 OnTester event 6.5.8 Auto-tuning: ParameterGetRange and ParameterSetRange 6.5.9 Group of OnTester events for optimization control 6.5.10 Sending data frames from agents to the terminal 6.5.11 Getting data frames in terminal 6.5.12 Preprocessor directives for the tester 6.5.13 Managing indicator visibility: TesterHideIndicators 6.5.14 Emulation of deposits and withdrawals 6.5.15 Forced test stop: TesterStop 6.5.16 Big Expert Advisor example 6.5.17 Mathematical calculations 6.5.18 Debugging and profiling 6.5.19 Limitations of functions in the tester Part 7. Advanced language tools 7.1 Resources 7.1.1 Describing resources using the #resource directive 7.1.2 Shared use of resources of different MQL programs 7.1.3 Resource variables 7.1.4 Connecting custom indicators as resources 7.1.5 Dynamic resource creation: ResourceCreate 7.1.6 Deleting dynamic resources: ResourceFree 7.1.7 Reading and modifying resource data: ResourceReadImage 7.1.8 Saving images to a file: ResourceSave 7.1.9 Fonts and text output to graphic resources 7.1.10 Application of graphic resources in trading 7.2 Custom symbols 7.2.1 Creating and deleting custom symbols 7.2.2 Custom symbol properties 7.2.3 Setting margin rates 7.2.4 Configuring quoting and trading sessions 7.2.5 Adding, replacing, and deleting quotes 7.2.6 Adding, replacing, and removing ticks 7.2.7 Translation of order book changes 7.2.8 Custom symbol trading specifics 7.3 Economic calendar 7.3.1 Basic concepts of the calendar 7.3.2 Getting the list and descriptions of available countries 7.3.3 Querying event types by country and currency 7.3.4 Getting event descriptions by ID 7.3.5 Getting event records by country or currency 7.3.6 Getting event records of a specific type 7.3.7 Reading event records by ID 7.3.8 Tracking event changes by country or currency 7.3.9 Tracking event changes by type 7.3.10 Filtering events by multiple conditions 7.3.11 Transferring calendar database to tester 7.3.12 Calendar trading 7.4 Cryptography 7.4.1 Overview of available information transformation methods 7.4.2 Encryption, hashing, and data packaging: CryptEncode 7.4.3 Data decryption and decompression: CryptDecode 7.5 Network functions 7.5.1 Sending push notifications 7.5.2 Sending email notifications 7.5.3 Sending files to an FTP server 7.5.4 Data exchange with a web server via HTTP/HTTPS 7.5.5 Establishing and breaking a network socket connection 7.5.6 Checking socket status 7.5.7 Setting data send and receive timeouts for sockets 7.5.8 Reading and writing data over an insecure socket connection 7.5.9 Preparing a secure socket connection 7.5.10 Reading and writing data over a secure socket connection 7.6 SQLite database 7.6.0 Principles of database operations in MQL5 7.6.1 SQL Basics 7.6.2 Structure of tables: data types and restrictions 7.6.3 OOP (MQL5) and SQL integration: ORM concept 7.6.4 Creating, opening, and closing databases 7.6.5 Executing queries without MQL5 data binding 7.6.6 Checking if a table exists in the database 7.6.7 Preparing bound queries: DatabasePrepare 7.6.8 Deleting and resetting prepared queries 7.6.9 Binding data to query parameters: DatabaseBind/Array 7.6.10 Executing prepared queries: DatabaseRead/Bind 7.6.11 Reading fields separately: DatabaseColumn Functions 7.6.12 Examples of CRUD operations in SQLite via ORM objects 7.6.13 Transactions 7.6.14 Import and export of database tables 7.6.15 Printing tables and SQL queries to logs 7.6.16 Example of searching for a trading strategy using SQLite 7.7 Development and connection of binary format libraries 7.7.1 Creation of ex5 libraries; export of functions 7.7.2 Including libraries; #import of functions 7.7.3 Library file search order 7.7.4 DLL connection specifics 7.7.5 Classes and templates in MQL5 libraries 7.7.6 Importing functions from .NET libraries 7.8 Projects 7.8.1 General rules for working with local projects 7.8.2 Project plan of a web service for copying trades and signals 7.8.3 Nodejs based web server 7.8.4 Theoretical foundations of the WebSockets protocol 7.8.5 Server component of web services based on the WebSocket protocol 7.8.6 WebSocket protocol in MQL5 7.8.7 Client programs for echo and chat services in MQL5 7.8.8 Trading signal service and test web page 7.8.9 Signal service client program in MQL5 7.9 Native python support 7.9.1 Installing Python and the MetaTrader5 package 7.9.2 Overview of functions of the MetaTrader5 package for Python 7.9.3 Connecting a Python script to the terminal and account 7.9.4 Error checking: last_error 7.9.5 Getting information about a trading account 7.9.6 Getting information about the terminal 7.9.7 Getting information about financial instruments 7.9.8 Subscribing to order book changes 7.9.9 Reading quotes 7.9.10 Reading tick history 7.9.11 Calculating margin requirements and evaluating profits 7.9.12 Checking and sending a trade order 7.9.13 Getting the number and list of active orders 7.9.14 Getting the number and list of open positions 7.9.15 Reading the history of orders and deals 7.10 Built-in support for parallel computing: OpenCL Conclusion
دانلود کتاب MQL5 Programming for Traders