Real author:
Microsoft Corporation. Source code taken from .Net Framework 4.6.1.
Note: The library works on the MetaTrader 4 build 1384 and higher.
Unzip the archive into the terminal_data_folder.
The library codes are located in the: <terminal_data_folder>\MQL4\Include\RegularExpressions\
Sample test scripts can be found in the <terminal_data_folder>\MQL4\Scripts\RegularExpressionsExamples\
Here is a translation of the RegularExpressions from .Net Framework 4.6.1.
To work with the library, include the Regex.mqh file from the "\MQL4\Include\RegularExpressions\" directory in your code.
Several illustrative examples are provided with the library, which at the same time serve as the test cases. All the samples are taken from the official site of Microsoft Corporation, they vividly demonstrate the main differences from the regular expressions in C# and the features of their use in the MQL4.
Below is more detailed information about RegularExpressions MQL4 ported library packages:
| Packages | Description |
|---|---|
| CharUnicodeInfo.mqh | Archived txt file to determine the Unicode categories for all symbols (including non-Latin characters). |
| RegexCapture.mqh | Represents the results from a single successful subexpression capture. |
| RegexCaptureCollection.mqh | Represents the set of captures made by a single capturing group. |
| RegexGroup.mqh | Represents the results from a single capturing group. |
| RegexGroupCollections.mqh | Represents a collection of Group objects. |
| RegexMatch.mqh | Represents the results from a single regular expression match. |
| RegexMatchCollection.mqh | Represents a collection of successful matches found by iteratively applying the regular expression pattern to the input string. |
| Regex.mqh | Represents an immutable regular expression |
| RegexOptions.mqh | Provides enumerated values to use to set regular expression options. |
The regular expression parameters from the file RegexOptions.mqh:
| Parameter | Description |
|---|---|
| None | Specifies that no options are set. |
| IgnoreCase | Specifies case-insensitive matching. |
| Multiline | Specifies multiline mode. |
| ExplicitCapture | Do not capture unnamed groups. Specifies that the only valid captures are explicitly named or numbered groups of the form (?<name> subexpression). |
| Singleline | Specifies single-line mode. |
| IgnorePatternWhitespace | Eliminates unescaped white space from the pattern and enables comments marked with #. |
| RightToLeft | Specifies that the search will be from right to left instead of from left to right. |
| Debug | Specifies that the program works in the debug mode. |
| ECMAScript | Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the IgnoreCase and Multiline values. |
Working with RegularExpressions for MQL4:
//--- Code in C# Regex rx = new Regex(@"\b(?<word>\w+)\s+(\k<word>)\b", RegexOptions.IgnoreCase); string text = "The the quick brown fox fox jumped over the lazy dog dog."; MatchCollection matches = rx.Matches(text); foreach (Match match in matches) { //--- handling } //--- Code in MQL4 Regex *rx = new Regex("\\b(?<word>\\w+)\\s+(\\k<word>)\\b", RegexOptions::IgnoreCase); string text = "The the quick brown fox fox jumped over the lazy dog dog."; MatchCollection *matches = rx.Matches(text); IEnumerator<Match*> *en = matches.GetEnumerator(); while(en.MoveNext()) { Match *match = en.Current(); //--- handling } delete rx; delete matches; delete en; Regex::ClearCache();
To learn more about the RegularExpressions for MQL4 and its features, use the provided Tests.mqh expert. It implements numerous examples of regular expression usage, which cover all the main functionality of the library.
Tr

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/16566
Engulfing with RSI
Not really profitable but the code fits on one page.
Previous Candle Hi-Lo
Previous Candle Hi-Lo is used to check the last candle multi-timeframe position relative to the current price.
Symbol Movement
This custom indicator will show you 28 pair's daily candle range, High-Low range, candle bullishness or bearishness from real tick market. So you can understand the overall market situation very short time. You can change the default timeframe from Daily to any period and default candle (bar) number from 0 to any previous number. Also you can open the required symbol by clicking the symbol button.
BarNumbers
Displays the number of each bar - both, relative to the most current bar and in absolute terms from the beginning of the chart.