Skip to content

Files

Latest commit

 

History

History
97 lines (62 loc) · 2.35 KB

getting-started.md

File metadata and controls

97 lines (62 loc) · 2.35 KB

Getting started

Installation

talipp can be installed from the following sources:

:simple-pypi:  PyPI
pip install talipp
:simple-github:  GitHub
pip install git+https://github.com/nardew/talipp.git@main
:simple-condaforge:  Conda
conda install conda-forge::talipp

Essentials

Import indicators

Indicators can be imported as

from talipp.indicators import <indicator_name>

For instance, to import [EMA][talipp.indicators.EMA.EMA] indicator, use

from talipp.indicators import EMA

List of all indicators can be found in the Indicator catalogue.

Basic usage

Indicators can be fed input values either during their initialization

from talipp.indicators import EMA

ema = EMA(period=3, input_values=[1, 2, 3, 4, 5])

or incrementally

from talipp.indicators import EMA

ema = EMA(period=3)
ema.add(1)
ema.add(2)
...

To print indicator's values you can treat each indicator as a list, i.e. you can do

from talipp.indicators import EMA

ema = EMA(period=3, input_values=[1, 2, 3, 4, 5])

print(ema[-1])
print(ema[-5:])
print(ema)

Detailed description of indicator manipulation can be found in the section Indicator operations.

Input types

Indicators can accept two types of input - simple type such as float or complex [OHLCV][talipp.ohlcv.OHLCV] type encapsulating structured data such as open price, high price, low price, close price, ...

Each indicator specifies what type of input is required. For instance, [SMA][talipp.indicators.SMA.SMA] indicator accepts float while [Stoch][talipp.indicators.Stoch.Stoch] indicator accepts OHLCV.

from talipp.indicators import SMA, Stoch
from talipp.ohlcv import OHLCV

sma = SMA(period=3, input_values=[1, 2, 3])
stoch = Stoch(period=3, smoothing_period=2, input_values=[OHLCV(1, 2, 3, 4), OHLCV(5, 6, 7, 8)])

Read more about input types in the Input types section.

Examples

The library comes with examples showcasing usage of each indicator on artificial input.

If you have a binance account, then you can check examples of indicators on realtime data.