Discussing the article: "MQL5 Wizard Techniques you should know (Part 69): Using Patterns of SAR and the RVI"

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: MQL5 Wizard Techniques you should know (Part 69): Using Patterns of SAR and the RVI.
The Parabolic-SAR (SAR) and the Relative Vigour Index (RVI) are another pair of indicators that could be used in conjunction within an MQL5 Expert Advisor. This indicator pair, like those we’ve covered in the past, is also complementary since SAR defines the trend while RVI checks momentum. As usual, we use the MQL5 wizard to build and test any potential this indicator pairing may have.
The Parabolic Stop-And-Reverse (SAR) indicator and the Relative Vigour Index (RVI) oscillator are our next pairing to consider within these series. This time, this duo brings together trend identification with momentum tracking. As we have in past articles, we consider 10 possible signal patterns that can be generated from combining these two indicators, and we have them tested in a wizard assembled Expert Advisor. With that, let's look at the definitions of these 2 indicators.
Our optimization and testing is performed on the symbol GBP CHF for the year 2023 on the 4-hour time frame. We are testing one pattern at a time. Because we use MQL5’s inbuilt parameter of ‘m_patterns_used’, we have to implement our own map with an input parameter ‘PatternsUsed’. This is an integer value that serves as a bitmap to the combination of patterns used at any one time. In our case, though, we are using only one pattern at a time. The reasons for this were highlighted in earlier articles, and readers are free to revisit those for a refresher. Our patterns are indexed 0 to 9 and to get the integer value that exclusively maps to a specific pattern, we simply take 2 to the power of the pattern’s index. If we are using pattern 0 then the map is 2 to the power 0 which gives us 1. If the pattern index is 4 then the used map value will be 2 to the power 4 which gives us 16. And so on.
The forward walk is performed on the year 2025 which gives us a total period spanning from 2023.01.01 up to 2025.01.01. This window is clearly limited for anyone considering taking this further as testing should ideally be performed across different market types and these market types tend to span several years if not decades.
Author: Stephen Njuki