Best indicators for finding when a pair is ranging?

Im coding a couple of eas and they all have the same problem.
They make money on trends but then it hits a phase where the pair is not trending and i lose most of the winnings
If I can find a way to tell when market is ranging and have the EA turn itself off during that phase then id be onto a winner!

Alas, the ever ending predicament of every trader. Trending to ranging or ranging to trending. I’d personally focus on how to define a range from a quantifiable prospective. Once these boundaries are broken (for the specific time frame in question), you could assume a trend is forming.

Of course, the issue is fake breaks of a range.

Why not focus the EA on markets that are in a current strong trend. Manually implementing the EA into these markets as and when you see fit, at least for now.

I try to only trade with well established trends and I use some crude visual filters to confirm trending prices - if some of these are absent, either there is no trend or it is weaker than I would like, e.g. for an uptrend -

  • price is above 200EMA and 50SMA
    and
  • price is up over last 6mths and 3mths

I like to see at least 3 weekly bars not intersected by the 200EMA.
I like to see the last weekly bar not overlapping with more than the previous 3 consecutive weekly bars.

Obviously, you can set any number of similar parameters and vary them indefinitely, also your rules for which to regard as sacred and which as merely desirable. Its simple stuff but the chart analysis is completely objective - either price is above this line or it is not, there is no argument about that. Also it allows for rapid meaningful comparison of recent price action two very different instruments, and helps select the better one for a trend-following trade.

I don’t know anything about coding, and I only trust the most simple TA, but maybe these or similar filters can be written in?

I like the simple short and medium term moving average cross over. When price is above the short EMA and the short EMA is above the medium then I consider there to be an up trend (and vice versa for a down trend). If there are any tangles or price is in between EMAs then the market is ranging

ADX

On the contrary, I found this article a good read (just scroll down when the link opens)

It describes by the author why perhaps no indicators can be used to identify when a market is trending, or perhaps not.

Indicator Bullshit: Do You Really Think All of the Indicators Will Help You Win? - TurtleTrader® The Original from Michael Covel

Simple answer: When price is ranging we can also say price is oscillating (oscillate [verb]: to move or swing back and forth in a regular rhythm.) So when price is oscillating the go-to indicators should perhaps naturally be OSCILLATORS (take your pick) Your’s is a good question because the common mistake many inexperienced and dare I say ill-informed traders make is first, using indicators in isolation and second, trading indicator signals without considering prevailing market conditions of which there are broadly three: strong trending, weak trending (think rising/falling channel) and ranging. These dstinctions are crucial particularly if you’re a fibanacci trader. Now while the market is ranging say, your Stochastic indicator for example (an oscillator) may be producing winning signals 7 out of 10 times leaving you wondering why no one told you that this is like picking up money from the floor… But a day, week or a month later the market breaks into a strong trend and suddenly you find the selfsame Stochastic indicator that was SO reliable just a day or so earlier is now generating false signal after false signal and in double quick time you’re back to square 1. This is probably the main reason why we often hear novice traders complaining about ‘unreliable’, ‘useless’ indicators. But in reality the indicators themselves are not the problem. What we need to do is first understand the indicator itself, know what ‘indicates’ (obviously) and then identify exactly the market conditions under which we can rely on the signals it generates. For example, I would generally ignore regular bearish divergence (Stochastic/MACD - both oscillators) in a strong trending bull market (due to the high percentage of false signals) but pay close attention to both bullish and bearish divergence in a ranging or weak trending (bullish or bearish) market where I have a much higher success rate using these particular indicators.Edit: Misread/misinterpreted a question (again). Thought you basically asked which indicators are best suited for range trading. My apologies. But anyway, trading manually I normally take the hint after 2/3 consecutive stop outs on the same pair (in what was originally a strong trending market. At which point I just get out - a manual" Stop strategy" command if you will. In order to contain your losses does your EA not have any such command!? Might prove handy while you’re still searching for this special indicator…But here I really don’t know much at all so I hope another forum member submits a better, more useful answer •