Discussing the article: "Market Simulation: Getting started with SQL in MQL5 (IV)"

 

Check out the new article: Market Simulation: Getting started with SQL in MQL5 (IV).

Many people tend to underestimate SQL, or even not use it at all, because they do not fully understand how it actually works. When running queries against an SQL database, we are not always looking for a universal answer; in some cases, we need a very specific and practical answer. If a database is created with a proper structure and data model, almost any type of information can be integrated into it.

In the previous article Market Simulation: Getting started with SQL in MQL5 (III) we showed how an SQL script can be embedded in an executable file created in MQL5. However, we did not stop there. We also made some changes to the class code to make it much easier to use and, of course, adjusted the way the code is implemented a little.

Although the class code presented in the previous article is very useful for creating a database using built-in SQLite in MetaTrader 5 (which we will discuss later), this code does not allow us to execute queries from MQL5.

Therefore, the main goal of this article is to explain as clearly as possible how this class can be modified to add the code needed to execute queries. In other words, here we will implement a system that will allow us to execute queries against an SQLite-based database.


Author: Daniel Jose