Discussion of article "Category Theory in MQL5 (Part 8): Monoids"


New article Category Theory in MQL5 (Part 8): Monoids has been published:

This article continues the series on category theory implementation in MQL5. Here we introduce monoids as domain (set) that sets category theory apart from other data classification methods by including rules and an identity element.

To illustrate the possible application of monoids to traders we will consider 5 decisions some or most traders may be faced with before executing trades. These are:

  1. The length of the lookback period to consider.
  2. The chart time frame to use.
  3. The applied price to use.
  4. The indicator to select.
  5. And whether, given this information, to trade with the range, or the trend.

For each of these decisions we will come up with:

  • a set of possible values from which to choose;
  •  a binary operation that helps select between any two elements. This operation can be an MQL5 method that is called by another method iteratively through all the sets elements until one selection is made.
  • And an index for the identity element of this set. Index because this element will be in a set which is an array.
  • The choice of the ideal binary operation which simply chooses between 2 elements will be one of the following:
  • The operation that chooses the lesser of the two elements.
  •  The operation that chooses the greatest of the two elements being evaluated
  •  The operation that chooses from the set, the element closest to the mean of the two elements in the binary operation.
  •  And finally, the operation that chooses from the set the element that is furthest from the mean of the two elements in the binary operation.

We are considering 5 decision points of lookback period, timeframe, applied price, indicator, and signal interpretation. Another trader may have different key decision points. It is therefore important to keep in mind this is not a definitive step by step guide but is something that is simply chosen for this article.

Author: Stephen Njuki