Discussing the article: "Category Theory in MQL5 (Part 13): Calendar Events with Database Schemas"

 

Check out the new article: Category Theory in MQL5 (Part 13): Calendar Events with Database Schemas.

This article, that follows Category Theory implementation of Orders in MQL5, considers how database schemas can be incorporated for classification in MQL5. We take an introductory look at how database schema concepts could be married with category theory when identifying trade relevant text(string) information. Calendar events are the focus.

Calendar events are spawned almost daily, with most of them being pre-marked months in advance. Sourced via the MetaTrader Economic Calendar, they highlight currency and macroeconomic indicators for China, US, Japan, Germany, EU, UK, South Korea, Singapore, Switzerland, Canada, New Zealand, Australia, and Brazil. The list seems dynamic so more countries could get added in the future. These indicators are formatted often, but not always with numeric values that primarily feature a forecast value and an actual value and a previous value. Note that I mention ‘formatted often’ this is because not all indicators have numeric values, or even among those that do the number and format of the actual numbers does vary quite a bit. Put differently there is a lot of incomparability and this in a sense presents our problem statement.

In order to use the indicator readings for these currencies and economies, traders need to reliably and consistently be able to read the numeric values and, or accurately interpret their posted text. Let’s illustrate this by looking at a few typical calendar events.


cal_1


cal_2


cal_3


cal_4


Above we have four events for China, US, Japan and Germany that capture an index, percentage yields, monetary amounts, and an undefined value, respectively. This information can be extracted in MQL5 via simple methods as shown below.

Author: Stephen Njuki