"There are various ways to detect trends with moving averages. The moving average is a rolling filter and uptrends are detected when either the price is above the moving average or when the moving average’s slope is positive.
Given that an SMA can be well approximated by a constant-α AMA, it makes a lot of sense to adopt the AMA as the principal representative of this family of indicators. Not only it is potentially flexible in the definition of its effective lookback but it is also recursive. The ability to compute indicators recursively is a very big positive in latency-sensitive applications like high-frequency trading and market-making. From the definition of the AMA, it is easy to derive that AMA > 0 if P(i) > AMA(i-1). This means that the position of the price relative to an AMA dictates its slope and provides a way to determine whether the market is in an uptrend or a downtrend."
To formalize, define the upside and downside deviations as the same sensitivity moving averages of relative price appreciations and depreciations from one observation to another: