âšī¸ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://hexdocs.pm/talib/TAlib.Indicators.MA.html |
| Last Crawled | 2026-04-11 23:42:17 (3 days ago) |
| First Indexed | 2021-12-23 18:13:15 (4 years ago) |
| HTTP Status Code | 200 |
| Meta Title | TAlib.Indicators.MA â TAlib v0.3.6 |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | Moving Average indicator
Wikipedia
Calculate SMA, WMA, and EMA
Link to this section
Summary
Functions
Calculate Cumulative Moving Average
Calculate Exponential Moving Average
Calculate a list of EMA
Calculate Simple Moving Average
Calculate a list of SMA
Update Cumulative Moving Average when new price comes
Update Exponential Moving Average when new price comes
Update Simple Moving Average when new price comes
Calculate Weighted Moving Average
Link to this section
Functions
Calculate Cumulative Moving Average
Parameters
prices: List of prices, lates price is the first one in the list.
period: MA period to be calculated. It must be less than size of prices
Example
iex>
TAlib.Indicators.MA
.
cma
(
[
0
,
1
,
2
,
3
]
,
3
)
2.0
Calculate Exponential Moving Average
Parameters
prices: List of prices, lates price is the first one in the list.
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
ema
(
[
0
,
1
,
2
,
3
]
,
3
)
1.0
Calculate a list of EMA
Parameters
prices: List of prices, lates price is the last one in the list.
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
ema_list
(
1330.95
,
1334.65
,
...
]
,
3
)
[
nil
,
nil
,
44.3289
,
44.2096
,
44.1796
...
]
Calculate Simple Moving Average
Parameters
prices: List of prices, lates price is the first one in the list.
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
sma
(
[
1
,
2
,
3
,
4
]
,
3
)
3.0
Calculate a list of SMA
Parameters
prices: List of prices, lates price is the last one in the list.
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
sma_list
(
1330.95
,
1334.65
,
...
]
,
3
)
[
nil
,
nil
,
44.3289
...
]
Update Cumulative Moving Average when new price comes
Parameters
current_cma: Previously calculated CMA
new_value: New price to be added in the list
period: MA period to be calculated.
Example
iex>
TAlib.Indicators.MA
.
update_cma
(
44.4513
,
44
,
4
)
44.36104
Update Exponential Moving Average when new price comes
Parameters
current_ema: Previously calculated EMA
new_value: New price to be added in the list
period: MA period to be calculated.
Example
iex>
TAlib.Indicators.MA
.
update_ema
(
1306.72
,
1300
,
50
)
,
4
)
1306.456471
Update Simple Moving Average when new price comes
Parameters
prices: List of prices, newest price is the first one in the list.
current_sma: Previously calculated SMA
new_value: New price to be added in the list
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
update_sma
(
@prices
,
44.6028
,
46.0826
,
10
)
,
4
)
44.6028
Calculate Weighted Moving Average
Parameters
prices: List of prices, lates price is the first one in the list.
period: MA period to be calculated. It must be equal or less than size of prices
Example
iex>
TAlib.Indicators.MA
.
wma
(
[
0
,
1
,
2
,
3
]
,
3
)
2.3333333333333335 |
| Markdown | Toggle Sidebar
Toggle Theme
[TAlib v0.3.6](https://hexdocs.pm/talib/api-reference.html)
- [Pages](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#full-list)
- [Modules](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#full-list)
- [TAlib](https://hexdocs.pm/talib/TAlib.html "TAlib")
- [Top](https://hexdocs.pm/talib/TAlib.html#content)
- [TAlib.Indicators.MA](https://hexdocs.pm/talib/TAlib.Indicators.MA.html "TAlib.Indicators.MA")
- [Top](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#content)
- [Summary](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#summary)
- [Functions](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#functions)
- [cma/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#cma/2)
- [ema/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema/2)
- [ema\_list/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema_list/2)
- [sma/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma/2)
- [sma\_list/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma_list/2)
- [update\_cma/3](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_cma/3)
- [update\_ema/3](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_ema/3)
- [update\_sma/4](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_sma/4)
- [wma/2](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#wma/2)
- [TAlib.Indicators.MACD](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html "TAlib.Indicators.MACD")
- [Top](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#content)
- [Summary](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#summary)
- [Functions](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#functions)
- [histogram/4](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#histogram/4)
- [macd/3](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#macd/3)
- [signal/2](https://hexdocs.pm/talib/TAlib.Indicators.MACD.html#signal/2)
- [TAlib.Indicators.RSI](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html "TAlib.Indicators.RSI")
- [Top](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#content)
- [Summary](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#summary)
- [Functions](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#functions)
- [average\_gain/2](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#average_gain/2)
- [average\_loss/2](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#average_loss/2)
- [gain/1](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#gain/1)
- [loss/1](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#loss/1)
- [rsi/2](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#rsi/2)
- [rsi\_list/3](https://hexdocs.pm/talib/TAlib.Indicators.RSI.html#rsi_list/3)
- [TAlib.Indicators.Stochastic](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html "TAlib.Indicators.Stochastic")
- [Top](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html#content)
- [Summary](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html#summary)
- [Functions](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html#functions)
- [stochastic\_d/3](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html#stochastic_d/3)
- [stochastic\_k/2](https://hexdocs.pm/talib/TAlib.Indicators.Stochastic.html#stochastic_k/2)
# TAlib v0.3.6 TAlib.Indicators.MA
Moving Average indicator [Wikipedia](https://en.wikipedia.org/wiki/Moving_average) Calculate SMA, WMA, and EMA
# [Link to this section](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#summary) Summary
## [Functions](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#functions)
[cma(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#cma/2)
Calculate Cumulative Moving Average
[ema(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema/2)
Calculate Exponential Moving Average
[ema\_list(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema_list/2)
Calculate a list of EMA
[sma(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma/2)
Calculate Simple Moving Average
[sma\_list(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma_list/2)
Calculate a list of SMA
[update\_cma(current\_cma, new\_value, period)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_cma/3)
Update Cumulative Moving Average when new price comes
[update\_ema(current\_ema, new\_value, period)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_ema/3)
Update Exponential Moving Average when new price comes
[update\_sma(prices, current\_sma, new\_value, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_sma/4)
Update Simple Moving Average when new price comes
[wma(prices, period \\\\ 50)](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#wma/2)
Calculate Weighted Moving Average
# [Link to this section](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#functions) Functions
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#cma/2 "Link to this function")
# cma(prices, period \\\\ 50)
Calculate Cumulative Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be less than size of prices
## Example
```
iex> TAlib.Indicators.MA.cma([0,1,2,3],3)
2.0
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema/2 "Link to this function")
# ema(prices, period \\\\ 50)
Calculate Exponential Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.ema([0,1,2,3],3)
1.0
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#ema_list/2 "Link to this function")
# ema\_list(prices, period \\\\ 50)
Calculate a list of EMA
## Parameters
- prices: List of prices, lates price is the last one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.ema_list(1330.95, 1334.65, ...] , 3)
[nil, nil, 44.3289, 44.2096, 44.1796 ...]
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma/2 "Link to this function")
# sma(prices, period \\\\ 50)
Calculate Simple Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.sma([1,2,3,4],3)
3.0
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#sma_list/2 "Link to this function")
# sma\_list(prices, period \\\\ 50)
Calculate a list of SMA
## Parameters
- prices: List of prices, lates price is the last one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.sma_list(1330.95, 1334.65, ...] , 3)
[nil, nil, 44.3289 ...]
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_cma/3 "Link to this function")
# update\_cma(current\_cma, new\_value, period)
Update Cumulative Moving Average when new price comes
## Parameters
- current\_cma: Previously calculated CMA
- new\_value: New price to be added in the list
- period: MA period to be calculated.
## Example
```
iex> TAlib.Indicators.MA.update_cma(44.4513,44, 4)
44.36104
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_ema/3 "Link to this function")
# update\_ema(current\_ema, new\_value, period)
Update Exponential Moving Average when new price comes
## Parameters
- current\_ema: Previously calculated EMA
- new\_value: New price to be added in the list
- period: MA period to be calculated.
## Example
```
iex> TAlib.Indicators.MA.update_ema(1306.72, 1300, 50), 4)
1306.456471
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#update_sma/4 "Link to this function")
# update\_sma(prices, current\_sma, new\_value, period \\\\ 50)
Update Simple Moving Average when new price comes
## Parameters
- prices: List of prices, newest price is the first one in the list.
- current\_sma: Previously calculated SMA
- new\_value: New price to be added in the list
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.update_sma(@prices, 44.6028, 46.0826, 10), 4)
44.6028
```
[Link to this function](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#wma/2 "Link to this function")
# wma(prices, period \\\\ 50)
Calculate Weighted Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.wma([0,1,2,3],3)
2.3333333333333335
```
Built using [ExDoc](https://github.com/elixir-lang/ex_doc "ExDoc") (v0.19.3), designed by [Friedel Ziegelmayer](https://twitter.com/dignifiedquire "@dignifiedquire") for the [Elixir programming language](https://elixir-lang.org/ "Elixir"). |
| Readable Markdown | Moving Average indicator [Wikipedia](https://en.wikipedia.org/wiki/Moving_average) Calculate SMA, WMA, and EMA
## [Link to this section](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#summary) Summary
## [Functions](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#functions)
Calculate Cumulative Moving Average
Calculate Exponential Moving Average
Calculate a list of EMA
Calculate Simple Moving Average
Calculate a list of SMA
Update Cumulative Moving Average when new price comes
Update Exponential Moving Average when new price comes
Update Simple Moving Average when new price comes
Calculate Weighted Moving Average
## [Link to this section](https://hexdocs.pm/talib/TAlib.Indicators.MA.html#functions) Functions
Calculate Cumulative Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be less than size of prices
## Example
```
iex> TAlib.Indicators.MA.cma([0,1,2,3],3)
2.0
```
Calculate Exponential Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.ema([0,1,2,3],3)
1.0
```
Calculate a list of EMA
## Parameters
- prices: List of prices, lates price is the last one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.ema_list(1330.95, 1334.65, ...] , 3)
[nil, nil, 44.3289, 44.2096, 44.1796 ...]
```
Calculate Simple Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.sma([1,2,3,4],3)
3.0
```
Calculate a list of SMA
## Parameters
- prices: List of prices, lates price is the last one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.sma_list(1330.95, 1334.65, ...] , 3)
[nil, nil, 44.3289 ...]
```
Update Cumulative Moving Average when new price comes
## Parameters
- current\_cma: Previously calculated CMA
- new\_value: New price to be added in the list
- period: MA period to be calculated.
## Example
```
iex> TAlib.Indicators.MA.update_cma(44.4513,44, 4)
44.36104
```
Update Exponential Moving Average when new price comes
## Parameters
- current\_ema: Previously calculated EMA
- new\_value: New price to be added in the list
- period: MA period to be calculated.
## Example
```
iex> TAlib.Indicators.MA.update_ema(1306.72, 1300, 50), 4)
1306.456471
```
Update Simple Moving Average when new price comes
## Parameters
- prices: List of prices, newest price is the first one in the list.
- current\_sma: Previously calculated SMA
- new\_value: New price to be added in the list
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.update_sma(@prices, 44.6028, 46.0826, 10), 4)
44.6028
```
Calculate Weighted Moving Average
## Parameters
- prices: List of prices, lates price is the first one in the list.
- period: MA period to be calculated. It must be equal or less than size of prices
## Example
```
iex> TAlib.Indicators.MA.wma([0,1,2,3],3)
2.3333333333333335
``` |
| Shard | 134 (laksa) |
| Root Hash | 18179701562649330534 |
| Unparsed URL | pm,hexdocs!/talib/TAlib.Indicators.MA.html s443 |