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: Defining your Edge (Part 3): Using HMM and GRU in an Expert Advisor.
We examine how a Hidden Markov Model (HMM) estimates latent market regimes while basing on observable price and indicator sequences. This is done by estimating the probability of state transitions. A Gated Recurrent Unit (GRU) network models time dependencies and keeps important information over several observations. In an Expert Advisor, HMM-based regime probabilities, can be merged with GRU-based sequence learning to better classify increments in accumulation, distribution, and momentum prior to their showing up in regular price confirmations.
When developing a trade system these days, adding a neural network to a trading algorithm is relatively easy. The hard part is showing that it improves a particular decision. Models that are elaborate can easily give one smooth backtest results while contributing little beyond the indicators and rules that are in place. This article therefore attempts to examine the problem via a custom MQL5 signal class that can be easily used as an Expert Advisor thanks to the MQL5 Wizard. In this signal class we are combining a Hidden Markov Model (HMM) with a Gated Recurrent Unit (GRU) network. We use the HMM to estimate whether the market is ranging, trending, or unusually volatile; while a GRU that will be trained for the identified regime would evaluate the recent price direction. When both are used, they would not replace any trading rules but rather they would establish if a proposed entry has merits.
This distinction gives us a testable question: Does a neural network confirmation of a specific market regime improve the admission of say trend-continuation trades on EURUSD H4 or does it only lessen the frequency of trading while repeating info already provided by ADX, DI, ATR, and price? Our method will approach the class in a similar manner as this question unfolds by: defining the trading decision; identifying a fair baseline; examining why the two engines could be suited for each other; translating their math into MQL5; and then finally confronting the backtest and forward-test results. Our goal here is not necessarily to prove why the two engines are a couple, but rather to establish any evidence that could justify that conclusion - as well as point out what evidence could have us reject this union.
Author: Stephen Njuki