Discussing the article: "MQL5 Wizard Techniques you should know (Part 100): Sliding Window Median and Bidirectional LSTM for a Custom Trailing Stop"

 

Check out the new article: MQL5 Wizard Techniques you should know (Part 100): Sliding Window Median and Bidirectional LSTM for a Custom Trailing Stop.

CTrailingSlidingMedianBiLSTM is a custom MQL5 Wizard trailing module that combines robust median/MAD outlier filtering with a BiLSTM context score in the range [-1, 1]. Four algorithm modes (standard, bands, RSI, adaptive) target noise, mean-reverting bursts and liquidity spikes, reducing premature stop adjustments. This module is intended for side-by-side evaluation with diverse entry signals and money management settings.

We resume our deep dive into MQL5 where we pitch new ideas and models that can be prototyped easily and proven thanks to the MQL5 Wizard. In this series we rotate between implementations of trailing stops, entry signals, and money management. The last article we published was money management so we look at a trailing stop model for this article. Within the articles where we have only looked at trailing stops, we have utilized algorithms such as Skip Lists, Reservoir Sampling, and the Convex Hull. These tools were very broad and not identical however they did tend to map persistent, long-term macroeconomic trends and were adept in "Z-type" (Whipsawed) markets.

Today, we consider a different model that is powered by a Sliding Window Median aka Hampel Filter and a Bidirectional LSTM neural network. In all these articles we do not aim to give the silver bullet, but rather try to expand the MQL5 Wizard toolkit by introducing a special situation model, that we can contrast with previous models already covered. We are making the case that algorithmic trading success could be dependent on pairing the right tools to the "right market" as perceived by the trader who is using this model(s).

Author: Stephen Njuki