Skip to content

Commit

Permalink
MkDocs (#125)
Browse files Browse the repository at this point in the history
* MkDocs
  • Loading branch information
nardew authored Apr 1, 2024
1 parent 0e5fe71 commit e903ae0
Show file tree
Hide file tree
Showing 136 changed files with 3,639 additions and 239 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pip install flake8 pytest
pip install -r requirements.txt
pip install -e .
- name: Install dependencies for backward compaibility
- name: Install dependencies for backward compatibility
run: pip install dataclasses
if: ${{ matrix.python-version == 'pypy3' }}
- name: Lint with flake8
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TALIpp - Incremental Technical Analysis Library
# talipp - Incremental Technical Analysis Library

![](https://img.shields.io/badge/python-3.8-blue.svg)
![](https://img.shields.io/badge/python-3.9-blue.svg)
Expand Down
97 changes: 97 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Getting started

## Installation

talipp can be installed from the following sources:

##### :simple-pypi:  PyPI

```bash
pip install talipp
```
##### :simple-github:  GitHub

```bash
pip install git+https://github.com/nardew/talipp.git@main
```

##### :simple-condaforge:  Conda

```bash
conda install conda-forge::talipp
```

## Essentials

### Import indicators

Indicators can be imported as

```python
from talipp.indicators import <indicator_name>
```

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

```python
from talipp.indicators import EMA
```

List of all indicators can be found in the [Indicator catalogue](indicators.md).

### Basic usage

Indicators can be fed input values either during their initialization

```python
from talipp.indicators import EMA

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

or incrementally

```python
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

```python
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](indicator-operations.md).

### 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`.

```python
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](input-types.md) section.

## Examples

The library comes with [examples](https://github.com/nardew/talipp/blob/main/examples/indicators.py) showcasing usage of each indicator on artificial input.

If you have a binance account, then you can check [examples](https://github.com/nardew/talipp/blob/main/examples/binance_online.py) of indicators on realtime data.
Loading

0 comments on commit e903ae0

Please sign in to comment.