Hi @stephenNJUKI,
Thanks for sharing the great piece of code. Would you mind showing the settings that you use to achieve the backtest results shown in the article?
When I'm running the EA, it is trading non-stop making 3943 trades per year and seem to disregard the signal completely.
I'm particularly interested in pattern 2. It is clear that bitmask for it will be 4 but what about other values?

Hi @stephenNJUKI,
Thanks for sharing the great piece of code. Would you mind showing the settings that you use to achieve the backtest results shown in the article?
When I'm running the EA, it is trading non-stop making 3943 trades per year and seem to disregard the signal completely.
I'm particularly interested in pattern 2. It is clear that bitmask for it will be 4 but what about other values?
A growing number of people keep asking me about input settings, well the thing is I never hold onto them. What I always try to share within the article is the name of the traded pair, time frame used, and test-year (I usually test over just a single year)
The input settings are always from a short optimisation stint, are not cross validated, and therefore strictly speaking are not worth sharing.
The purpose of putting out the test reports is simply to demonstrate trade-ablity & use of the signal, nothing more. The work of looking for cross validated settings is always left up to the reader.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: MQL5 Wizard Techniques you should know (Part 48): Bill Williams Alligator.
The Alligator Indicator, which was the brain child of Bill Williams, is a versatile trend identification indicator that yields clear signals and is often combined with other indicators. The MQL5 wizard classes and assembly allow us to test a variety of signals on a pattern basis, and so we consider this indicator as well.
The Alligator indicator, that was developed by Bill Williams with the premise that markets tend to trend strongly in any set direction for only about 15 – 30% of the time. It inherently is a trend following tool that helps traders identify market direction and potential fractals or turning points. This it achieves by using a set of three smoothed moving averages (SMAs) that are not only set at different averaging periods, but are also shifted forward by varying amounts.
These three SMAs are often referred to as the Jaws, Teeth, and Lips in reference to the mouth of an Alligator. These 3 averaging buffers help traders visualize the phases of the market, which typically include trending phases, consolidating phases and transitioning phases. When the 3 averages are in a tight range, this is often referred to as the alligator taking a nap, which would align with what Bill Williams directionless phase that he estimated to take up 85 – 70% of the time in most markets. The other portion, (the 15 – 30%) is marked by these three buffers diverging, a divergence that is always signified by a particular direction for either bullishness or bearishness. This phase is often labelled the waking up of the Alligator, and it is supposed to be when most traders should look to make a buck.
Author: Stephen Njuki