# EMA

Exponential Moving Average (EMA) is a weighted approach derived from Simple Moving Average (SMA). EMA gives more weight to more recent price data with the core concept that the more recent the data is, the higher value it should have. In contrast, SMA gives equal weight throughout the averages regardless of time relevancy. Using a longer time period for moving averages indicate long term trends, short time frame periods indicates the short term trends.

{% hint style="info" %}
CFDHero EMA: a buy signal is generated when the short term EMA crosses above the long term EMA, a sell signal is generated when the short term EMA crosses below the long term EMA.
{% endhint %}

![](/files/-M64JNU121s8dh3BuwSh)

A rising EMA suggests an upward trend and a falling MA indicates a downtrend. EMA Crossing is a crossover signal is created when two different time period EMAs crossover in a chart. A bullish crossover happens when the short-term MA (blue) crosses above a long-term one (red), suggesting the start of an upward trend. In contrast, a bearish crossover happens when a short-term MA crosses below a long-term moving average, which indicates the beginning of a downtrend.&#x20;

```
SMA = ( Sum (Price, n) ) / n    
EMA = ( P - EMAp ) * K + EMAp

Where:
P = Price
EMAp = the Exponential moving Average for the previous period
K = 2 / (n + 1), the smoothing constant
n = Time Period
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cfdhero.com/technical-indicators/ema.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
