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.1.10.tar.gz (33.1 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.1.10-cp313-cp313-macosx_15_0_arm64.whl (205.1 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: rtta-0.1.10.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for rtta-0.1.10.tar.gz
Algorithm Hash digest
SHA256 c4878942be620d882a2193b9aabbaab4d59928244c00110f4140a4561f875cdf
MD5 4197aedff9a4b1428fb712a7f866901f
BLAKE2b-256 a063a284d3b47d88ff5575bae2732c17bba6ca099cf18affabfd16914012cc74

See more details on using hashes here.

File details

Details for the file rtta-0.1.10-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for rtta-0.1.10-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ce65992c1ab392147ac4350f84501ad18a98168c8d3d50c4b4d76160c98a9fce
MD5 96eb19f4be7434a080d6dbc57ff1c2d5
BLAKE2b-256 f14486d76d2274fd5c5198dc1fa15a86812353b3804585f04d850e505c09b8dd

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