Yes - recently I tested a system that can be optimised such that it works on all market conditions, but with different optimisations for each. I have yet to find an effective 'market condition' detector... I 'detected' the unhelpful market conditions, because those were the time-periods when it was getting 'stuck' (not increasing equity). How you do that programmatically, and not post-facto, I dunno.
It's working on the current conditions in EURUSD, but will probably do less well when a long trend starts again. I periodically retest and re-optimise.
This is also one of the issues I have with the dictum that one must optimise on a range of past data, test on a separate range. You can never be sure that your training and test data embody the same market conditions - a perfectly good system may seem not to work simply because you're implicitly expecting it to work under all market conditions, which is kind of unreasonable unless you've explicitly built that in (which, of course, if you know how to, you should).