Skip to main content

A small library for computing ALMA indicator for stocks

Project description

Arnaud Legoux Moving Average (ALMA) in Python

This is a small Technical Analysis library for the calculation of Arnaud Legoux Moving Average (ALMA). It is built in Pandas and Numpy and uses TA.

Description

The Arnaud Legoux Moving Average (ALMA) indicator is a superior moving average as compared to the Exponential Moving and Simple Moving Averages. Arnaud Legoux and Dimitrios Kouzis Loukas developed the indicator in the year 2009. The objective of ALMA is to minimize the noise and produce a more reliable signal than the conventional moving averages. The indicator (ALMA) removes small price fluctuations and also enhances the trend by applying a moving average (MA) twice, once from left to right, and once from right to left.

Key Points on ALMA Indicator

  • ALMA indicator works on the principle of the Moving Average (MA), but the calculation formula is more perfect.
  • The main difference in regards to conventional moving averages is its minimal lag.
  • The classic EMA, SMA, SMMA and other Moving Average lines have a significant minus – signal lag.
  • The MA ALMA in this regard is more perfect. In a volatile market, this tool shows very good trading results, even without the use of auxiliary filters.

The Arnaud Legoux moving average attempts to bridge the gap and thus is expected to show both responsiveness and smoothness at the same time. Generally, the Arnaud Legoux Moving Average indicator applies the moving average twice, once from left to right and the other from right from left with the process said to eliminate price lag or phase shift significantly, a problem that is common to the traditional moving averages.

Source: Read more on Stock Maniacs

How to Use

# import the package
from AlmaIndicator import ALMAIndicator

# define a Pandas dataframe which should contain closing price of the stocks
df = ...

# initialize the indicator
# you only need to provide a Pandas series of the closing price of the stock
alma_indicator = ALMAIndicator(close=df['close'])
# add alma to dataframe by calling the alma function
df['alma'] = alma_indicator.alma()

Sample Result

spy - data

Note that there will be NaN values at the beginning of the ALMA series since there is a window of analysis which is set to 9. In other words, your dataset must at least contain 9 entries.

Sample Figure

spy - alma

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AlmaIndicator-0.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

AlmaIndicator-0.0.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file AlmaIndicator-0.0.4.tar.gz.

File metadata

  • Download URL: AlmaIndicator-0.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for AlmaIndicator-0.0.4.tar.gz
Algorithm Hash digest
SHA256 82910f64454121071e190e356f1ca01e6f5fce6efaaaf3888c6101c97deab771
MD5 1301446c4da10c7042cf8ffe72ffcc72
BLAKE2b-256 d59fdbd80c443443522f449f3097429865170643a1d611c501da2cb780991e0d

See more details on using hashes here.

File details

Details for the file AlmaIndicator-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: AlmaIndicator-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for AlmaIndicator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 298551d9091ef3b5a15d51668fc2ea23b77af7eda92cdecad1b3d0bbc8cebae9
MD5 b5c2f6268f43adc299cf6512e9e9a7bb
BLAKE2b-256 966bab37a94c73ec0a5821faa2dc82430bd7356d8738b5cbf656b2e11256e59b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page