The author of the idea: Scriptor
MQL5 code author: barabashkakvn
The EA only operates when a new bar appears. Position volume is always fixed and set in the Lots parameter. Stop Loss, Take Profit and Trailing Stop parameters can be disabled - to do this, set the appropriate value to "0.0". The last Trailing Step parameter - trailing step.
Two Moving Averages (First and Second) are used. The crossing is defined in a very simple way (this is not the most accurate method, but it is the easiest one) - by analyzing the indicators values on two adjacent bars:
//--- Buy Signal if(MA_First>MA_Second+ExtMA_MinimumDistance && MA_First<MA_Second-ExtMA_MinimumDistance) ... //--- Sell signal if(MA_First<MA_Second-ExtMA_MinimumDistance && MA_First>MA_Second+ExtMA_MinimumDistance) ...
Then each signal is checked by the filter using the Momentum indicator - the Momentum filter parameter override is checked.
Visually, this looks as follows:
Test on EURUSD M15:
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/21515
The Rj_SlidingRangeRj_Digit_System indicator with the timeframe selection option available in the input parameters.Rj_SlidingRangeRj_Digit_System
The indicator paints candles going beyond the Rj_SlidingRangeRj_Digit channel.