Using built in standard indicators, how to tell EA it is ranging now or trending.

 

My method is using Envelop and a MA.

This is what I tell my EA.

if ma is within the envelope, then it is range

else trend 

 

What is your method? 

Reason: