Signals
EMA — Exponential Moving Average
Weight recent prices more heavily for faster trend response.
What it is
The Exponential Moving Average is a rolling average that weights recent prices more heavily than older prices, so it reacts faster than an SMA.
When to use it
- Following shorter-term trend changes that an SMA may miss.
- Creating momentum-aware crossover systems such as
EMA_12versusEMA_26. - As a building block for composite indicators like MACD.
The maths
EMA[t] = close[t] × k + EMA[t-1] × (1 - k) where k = 2 / (N + 1) The first EMA value is seeded with the SMA.
What it tells you
Reacts faster than SMA to recent price changes. Used in MACD and many crossover systems. A steeply rising EMA is a sign of strong momentum.
REST example
python
import os
import requests
response = requests.get(
'https://api.financedata.com/v1/signals/EMA/AAPL',
params={'start_date': '2025-01-01', 'end_date': '2025-04-30', 'period': 20},
headers={'X-API-Key': os.environ['FDA_KEY']},
timeout=30,
)
response.raise_for_status()
print(response.json())MCP example
Tool call body
{
"name": "get_ema",
"arguments": {
"symbol": "AAPL",
"start_date": "2025-01-01",
"end_date": "2025-04-30",
"period": 20
}
}Agent prompt that triggers it
Fetch the 20-day exponential moving average for AAPL and tell me whether it is rising into the latest reading.