Trend and Range Indicator

 

here are some thoughts i have for a ea that im making

after alot of time i have found out that the reason why alot of ea's fail is they need to base the ea under 2 different rule bases

these conditions are either trending or ranging.

base 2 different sets of indications, 1 for trending and another for ranging

this is for short term, m5 or m1

what im wanting to find out is the best way to calculate trending or ranging so i can apply rules to each.

what im thinking is using ma's for trending

ranging i would use wpr and cci

whats your thoughts on something like this?

also is there a good way of detecting ranging or trending, i tried with adx but i cant seem to get a good indication from it.

 

RSI indicator is good

Reason: