Exponential Moving Average (EMA)
Moving average indicator which measures the trend direction over a period of time.
Exponential Moving Average (EMA) is a moving average indicator which measures the trend direction over a period of time. It places more importance on recent price data than other moving averages like SMA. Unlike other Moving Averages, EMA uses a multiplier which takes into account older data, even if they are outside of the period of days selected.
Trading application
EMA is a line which is shown within the price graph, moving close to the price and eventually intersecting with it. EMA moving above the price indicates a downtrend while EMA moving below the price indicates an uptrend. It can also act as a level of Support/Resistance in uptrends and downtrends, respectively.
We can interpret buy/sell signals by using 2 different EMA lines (one assessing a shorter period than the other). If the shorter EMA (e.g. a 20 day EMA) crosses upwards over the longer SMA (e.g. 50 days), it is a buy signal. The opposite, where the shorter EMA crosses downwards under the longer EMA, indicates a sell signal. Another interpretation arises when intersecting with the price. A shorter EMA crossing the price from the bottom up, while remaining above the longer EMA, is considered a buy signal in the same way that the shorter EMA crossing the price from above downwards, while the longer EMA is located above the shorter EMA, indicates a sell signal.
Calculation
For the first EMA(Previous day) we use SMA. SMA = sum of X days closing prices / X Multiplier = 2 / (Time periods used + 1 )
Parameters
Input Parameters
Name | Type | Range of value | Description |
| int | <1, int.MaxValue> | Number of bars used in the calculation. |
Output Parameters
Indicator ouptuts a single value.
Type | Range of value |
double | (0, double.MaxValue) |
Examples
Complete example
Last updated