EMA without the PECL trader extension

Maintainers

Details

github.com/romulodl/ema

Source

Issues

Installs: 695

Dependents: 2

Suggesters: 0

Security: 0

Stars: 8

Watchers: 2

Forks: 2

Open Issues: 0

pkg:composer/romulodl/ema

v3.0.0 2020-11-13 16:22 UTC

This package is auto-updated.

Last update: 2025-10-29 00:02:36 UTC


README

Calculate the EMA of giving values.

Ema

Instalation

composer require romulodl/ema

or add romulodl/ema to your composer.json. Please check the latest version in releases.

Usage

$ema = new Romulodl\Ema();
$values = $ema->calculate(array $values, int $period = 9);
// return array, $values[0] being the last one

For example:

$ema = new Romulodl\Ema();
$ema->calculate([10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);

Why did you do this?

The PECL Trading extension is crap and not everyone wants to install it. I am building a trading bot and building more complex trading indicators that use the EMA as a basic step.