>> Merka: How the EA can distinguish when we are in ranging or trending market to use the proper engine?
>> KashifNawaz: No need to identify trend. Engine 1 will keep working in ranging. Once your set level hit, (…) then engine 2 will active.
Here is a thought: There seems to be an unstated assumption for this discussion thread that the market is EITHER ranging OR trending. What if we would assume instead that the market is ranging AND trending, all of the time?
To explain: if we take the general definition of a trend, like “trend up = higher highs and higher lows”, we implicitely say that there is also some oscillation (a wave) in the price movement, between the highs and the lows. We can in fact describe any price movement (time series of price bars) as an ADDITION of a cyclical component (“wave”) and a linear component (“trend”). This is nothing new, for example John Ehlers has used this concept in his work on Cycle Analytics and Digital Signal Processing for trading, over 10 years ago (link: https://www.amazon.com/John-F.-Ehlers/e/B001IO9TCC).
This would support KashifNawaz’ idea to have a “range engine” running all the time, taking care of the wave component, and a “trend engine” kicking in as soon as the trend component gets above a certain level.