Low Latency incremental Technical Analysis
Project description
RTTA
Purpose
The purpose of this package is to implement a very low latency incremental technical analysis toolkit. Most technical analysis tool-kits work in a "batch mode" where you hand them a blob of data and in a pandas series and they return a series with the computed data. Incremental updates for these require O(n) work. There is one tool, talipp that is designed to support incremental updates, but it is implemented in pure python and is a little more than an order of magnitude slower than rtta. On a 5995WX talipp's exponential moving average requires 465ns; rtta's requires 36ns. A bare python function call requires 35ns, so we're about as fast as fast can be.
Installation
pip install rtta
Usage
Each operator has a paramater fillna. If set to false, nan values will be returned until the operation is "populated". If set to true, best guesses will be returned until the operation is populated.
So for example, our simple moving average SMAIndicator
works sort of like this:
>>> import rtta.trend as trend
>>> sma = trend.SMAIndicator(window=4, fillna=True)
>>> sma.update(1)
1
>>> sma.update(2)
1.5
>>> sma.update(3)
2
>>> sma.update(2)
2
>>> sma.update(2)
2.25 <- The 1 fell off the end of the sliding window
Performance
Indicator | Latency |
---|---|
SMA | 36ns |
EMA | 36ns |
MACD | 55ns |
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
Built Distribution
File details
Details for the file rtta-0.0.12.tar.gz
.
File metadata
- Download URL: rtta-0.0.12.tar.gz
- Upload date:
- Size: 311.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc0a057fb10cfc1001f495ce0689587424e4bae78ae75cedef2884b1a5bd95cd |
|
MD5 | 2397f7a1ac2bdbd8d3805a3b0c269ad1 |
|
BLAKE2b-256 | 6ae8cf742d9c1e825067898d9d3ed9a5a6ed4aa8a5fca58e049728eefcf62a21 |
File details
Details for the file rtta-0.0.12-cp311-cp311-macosx_12_0_x86_64.whl
.
File metadata
- Download URL: rtta-0.0.12-cp311-cp311-macosx_12_0_x86_64.whl
- Upload date:
- Size: 246.6 kB
- Tags: CPython 3.11, macOS 12.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0bd4acaeacdf2f0ea08a07020858198f8353e189a8dc95668ad071debea14cf |
|
MD5 | 6e58d0b6612ca3c24e85a94295ba884f |
|
BLAKE2b-256 | c65c019d3eb8b51c766b1b8a02e94b311d4c64f7322db3542b29bd9851cd0a87 |