indicative.indicators.ema#

Attributes#

Classes#

ema

EMA

Exponential Moving Average (EMA).

Module Contents#

class indicative.indicators.ema.ema[source]#

Bases: tuple

ema[source]#
indicative.indicators.ema.EMA_Return: TypeAlias = list[EMA_Output][source]#
class indicative.indicators.ema.EMA[source]#

Bases: indicative.protocols.IndicatorProtocol, indicative.mixins.IndicatorMixin

Inheritance diagram of indicative.indicators.ema.EMA

Exponential Moving Average (EMA).

The Exponential Moving Average (EMA) is a type of moving average that gives more weight to more recent prices. It is calculated by taking the average price of a security over a specified period of time, with more recent prices given more weight.

Parameters:

timeperiod (int) – The number of bars to use in the calculation of the EMA. Defaults to 30.

timeperiod: pydantic.PositiveInt = None[source]#
compute(close)[source]#

Compute the EMA.

Parameters:

close (Array) – The array of closing prices.

Returns:

A list of namedtuples containing the computed EMA values.

Return type:

EMA_Return

_(rec)[source]#

Compute the EMA using a Record object.

Parameters:

rec (Record) – A Record object containing the data.

Returns:

A list of namedtuples containing the computed EMA values.

Return type:

EMA_Return