IndicatorManagement
This library provides management of mathematical/financial indicators, without having any problem on large amount of series data. Please look Features
to see more details.
Dependencies
- Python 3.10+
I am planning to support lower Python version.
Installation
This module is available at PyPI, so you can download it via pip;
pip install --upgrade indicator-management
Features
Generate any indicators from any sources
You can generate any indicators you want. Here is a simple example.
from pprint import pprint
import random
from indicator_management import generate_sync
from indicator_management.indicators import (
RawSeriesIndicator as Raw,
ExponentialMovingAverage as EMA,
)
i1 = Raw(raw_values=range(5))
i2 = i1 * 2 + 50
i3 = EMA(i2)
pprint(list(generate_sync(i1=i1, i2=i2, i3=i3)))
The code above will print following;
[{'i1': 0, 'i2': 50, 'i3': 50},
{'i1': 1, 'i2': 52, 'i3': 50.19047619047619},
{'i1': 2, 'i2': 54, 'i3': 50.55328798185941},
{'i1': 3, 'i2': 56, 'i3': 51.072022459777564},
{'i1': 4, 'i2': 58, 'i3': 51.73182984456066}]
As you can see, you can mix any operations or indicators to generate your own indicator.
Strategy is also kind of indicator
Strategy is also kind of indicator, as it stores states. It's more complicated than usual indicators, but you can still customize it well! Please have a look at examples.
Plot your own indicators with convenience
This code will plot following graph;
As you can see, you can plot your indicators with convenience.
Summarization
-
You can mix many operations to generate your own indicators. (As you can see from example code above.)
-
You can easily integrate your source with it. You just have to prepare generator or asynchronous generator which yields values, wrap them in
RawSeriesIndicator
orAsyncRawSeriesIndicator
, and then perform arbitrary operation to make your own indicator with your data sources. -
You can inherit base classes of library's abstract indicators so you can perform any kind of complex operations. I will write documentation for such advanced features.
-
There are some number of functions and classes which pre-defines existing indicators, like RSI, MACD, BB, etc. I aim to make even more financial indicators to be built-in optimized in future.
-
This library stores only moving window of total data, so in case you process millions or even billions of data, you don't have to care about memory limit.
-
You can even plot your indicators by just defining indicators and pass those to
DataAnimator
, then the plotting will be automatically handled.
But, if you are interested in processing relatively small amount of data(Daily OHLCV for example) and interested in huge performance, then you can select alternative libraries like TA-lib.
Any contributions are welcome!
Any contributions are surely welcome! Following are list of major TODOs;
- Make better documentation
- Implement more financial indicators
- Internal optimizations
I am open to all kind of discussions. Don't hesitate to begin any discussion for this project!
Warning
This library is still under pre-alpha development, and API will be frequently changed.