Skip to main content

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

rtta-0.0.10.tar.gz (289.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rtta-0.0.10-cp311-cp311-macosx_12_0_x86_64.whl (226.4 kB view details)

Uploaded CPython 3.11macOS 12.0+ x86-64

File details

Details for the file rtta-0.0.10.tar.gz.

File metadata

  • Download URL: rtta-0.0.10.tar.gz
  • Upload date:
  • Size: 289.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for rtta-0.0.10.tar.gz
Algorithm Hash digest
SHA256 1507a7eedeb07372949afa8b0ef5c10a3fa6d30767e629a4342d6ddcc86e8e22
MD5 a3f06ff7fe82b05ca118a8e4e9b9b572
BLAKE2b-256 bc529389067d040bc13145041ed1410b79c2ec06f6923911c3d0b35b76c1a148

See more details on using hashes here.

File details

Details for the file rtta-0.0.10-cp311-cp311-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for rtta-0.0.10-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 94eba279d46b8a8d57edd48848bbbfbce59f71d138cdd92316cb52a339129034
MD5 76d07df6c477c50f8906dc97a2cd8ca1
BLAKE2b-256 b5a82c3602c9c2c17ee164cb73134567dc1999f24c470ed03a95498ff556bac1

See more details on using hashes here.

Supported by

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