Skip to main content

High-performance technical analysis library with 153 indicators, 100% TA-Lib compatible

Project description

TechKit

PyPI version Python License: MIT Documentation CI

TechKit is a high-performance technical analysis library for Python, featuring:

  • 🚀 153 Technical Indicators - Complete coverage of all TA-Lib indicators
  • Blazing Fast - C++ core with O(1) incremental updates
  • 🔄 100% TA-Lib Compatible - Drop-in replacement API
  • 📊 61 Candlestick Patterns - Full CDL pattern recognition
  • 🧵 Thread-Safe - Zero global state, parallel-ready
  • 📦 Zero Dependencies - Only NumPy required

Installation

pip install techkit

Platform Support

Platform Python Architecture
Linux 3.10-3.13 x86_64
macOS 3.10-3.13 x86_64, arm64
Windows 3.10-3.13 AMD64

Quick Start

Basic Usage

import numpy as np
from techkit import SMA, RSI, MACD, BBANDS

# Sample price data
prices = np.random.randn(100).cumsum() + 100

# Create indicators
sma = SMA(period=20)
rsi = RSI(period=14)
macd = MACD(fast=12, slow=26, signal=9)

# Calculate (batch)
sma_values = sma.calculate(prices)
rsi_values = rsi.calculate(prices)
macd_result = macd.calculate(prices)

print(f"SMA: {sma_values[-1]:.2f}")
print(f"RSI: {rsi_values[-1]:.2f}")
print(f"MACD: {macd_result.macd[-1]:.4f}")

Streaming / Incremental Updates

from techkit import SMA, RSI

sma = SMA(20)
rsi = RSI(14)

# Process bar by bar (O(1) per update)
for price in live_price_stream():
    sma_result = sma.update(price)
    rsi_result = rsi.update(price)
    
    if sma_result.valid and rsi_result.valid:
        print(f"SMA: {sma_result.value:.2f}, RSI: {rsi_result.value:.2f}")

TA-Lib Drop-in Replacement

# Before (TA-Lib)
import talib
sma = talib.SMA(prices, timeperiod=20)
rsi = talib.RSI(prices, timeperiod=14)
macd, signal, hist = talib.MACD(prices)

# After (TechKit) - Same API!
from techkit import talib_compat as ta
sma = ta.SMA(prices, timeperiod=20)
rsi = ta.RSI(prices, timeperiod=14)
macd, signal, hist = ta.MACD(prices)

Candlestick Patterns

from techkit import CDL_HAMMER, CDL_ENGULFING, CDL_MORNINGSTAR

# Detect patterns
hammer = CDL_HAMMER()
signals = hammer.calculate(open, high, low, close)

# Signals: +100 (bullish), -100 (bearish), 0 (none)
bullish_hammers = np.where(signals > 0)[0]

Indicator Chaining

from techkit import Chain, RSI, EMA, SMA

# Smoothed RSI: RSI(14) → EMA(9)
smoothed_rsi = Chain([RSI(14), EMA(9)])
result = smoothed_rsi.calculate(prices)

# Double smoothed: SMA(10) → SMA(5)
double_smooth = Chain([SMA(10), SMA(5)])
result = double_smooth.calculate(prices)

Pandas Integration

import pandas as pd
from techkit import talib_compat as ta

df = pd.read_csv('ohlcv.csv')

# Directly use DataFrame columns
df['SMA_20'] = ta.SMA(df['close'], timeperiod=20)
df['RSI_14'] = ta.RSI(df['close'], timeperiod=14)
df['ATR_14'] = ta.ATR(df['high'], df['low'], df['close'], timeperiod=14)

macd, signal, hist = ta.MACD(df['close'])
df['MACD'] = macd
df['MACD_Signal'] = signal
df['MACD_Hist'] = hist

📖 Documentation

Full Documentation: https://techkit-docs.netlify.app/

Quick Links

Topic Link
Installation Getting Started
Quick Start Quick Start Guide
Python API Python API Reference
All Indicators Indicator List
Examples Code Examples
Changelog Version History
中文文档 Chinese Documentation

API Documentation


Indicator Categories

Moving Averages (9)

SMA, EMA, WMA, DEMA, TEMA, KAMA, TRIMA, T3, MA

Momentum Indicators (26)

RSI, MACD, STOCH, STOCHF, STOCHRSI, CCI, ADX, ADXR, MOM, ROC, ROCP, ROCR, ROCR100, WILLR, MFI, ULTOSC, TRIX, APO, PPO, CMO, DX, PLUS_DI, MINUS_DI, PLUS_DM, MINUS_DM, AROON, AROONOSC, BOP

Volatility (4)

ATR, NATR, BBANDS, TRANGE

Volume (4)

OBV, AD, ADOSC, MFI

Statistics (9)

STDDEV, VAR, LINEARREG, LINEARREG_SLOPE, LINEARREG_INTERCEPT, LINEARREG_ANGLE, TSF, BETA, CORREL

Price Transform (4)

AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE

Math (6)

MAX, MIN, SUM, MIDPOINT, MIDPRICE, MINMAX

Cycle / Hilbert Transform (6)

HT_DCPERIOD, HT_DCPHASE, HT_TRENDMODE, HT_TRENDLINE, HT_PHASOR, HT_SINE

Parabolic SAR (2)

SAR, SAREXT

Candlestick Patterns (61)

CDL_DOJI, CDL_HAMMER, CDL_ENGULFING, CDL_MORNINGSTAR, CDL_EVENINGSTAR, CDL_3WHITESOLDIERS, CDL_3BLACKCROWS, CDL_HARAMI, CDL_PIERCING, CDL_DARKCLOUDCOVER, and 51 more...

Advanced Analytics (17)

Risk Metrics: SharpeRatio, SortinoRatio, CalmarRatio, MaxDrawdown, HistoricalVaR, CVaR

Volatility Models: EWMAVolatility, RealizedVolatility, ParkinsonVolatility, GARCHVolatility

Structure Analysis: ZigZag, SwingHighLow, PivotPoints

Pattern Recognition: HarmonicPattern, ChartPattern

Performance

TechKit uses C++ with O(1) incremental computation:

Operation TechKit TA-Lib
Single update O(1) O(n)
Batch (1000 bars) ~0.1ms ~0.2ms
Memory per indicator O(period) O(n)

Benchmark Example

import time
import numpy as np
from techkit import SMA

prices = np.random.randn(1_000_000).cumsum() + 100

# Batch mode
start = time.time()
result = SMA(20).calculate(prices)
print(f"Batch (1M points): {time.time() - start:.3f}s")

# Streaming mode
sma = SMA(20)
start = time.time()
for price in prices[:100_000]:
    sma.update(price)
print(f"Streaming (100K points): {time.time() - start:.3f}s")

Version Information

import techkit

print(techkit.__version__)       # "1.2.1"
print(techkit.version())         # "1.2.1"
print(techkit.version_tuple())   # (1, 2, 1)

License

MIT License - see LICENSE for details.

Links

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

techkit-1.2.9.tar.gz (50.8 kB view details)

Uploaded Source

Built Distributions

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

techkit-1.2.9-cp312-cp312-win_amd64.whl (305.5 kB view details)

Uploaded CPython 3.12Windows x86-64

techkit-1.2.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

techkit-1.2.9-cp312-cp312-macosx_11_0_arm64.whl (305.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

techkit-1.2.9-cp312-cp312-macosx_10_14_x86_64.whl (343.9 kB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

techkit-1.2.9-cp311-cp311-win_amd64.whl (302.5 kB view details)

Uploaded CPython 3.11Windows x86-64

techkit-1.2.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (448.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

techkit-1.2.9-cp311-cp311-macosx_11_0_arm64.whl (304.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

techkit-1.2.9-cp311-cp311-macosx_10_14_x86_64.whl (337.9 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

techkit-1.2.9-cp310-cp310-win_amd64.whl (302.5 kB view details)

Uploaded CPython 3.10Windows x86-64

techkit-1.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

techkit-1.2.9-cp310-cp310-macosx_11_0_arm64.whl (303.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

techkit-1.2.9-cp310-cp310-macosx_10_14_x86_64.whl (336.5 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

Details for the file techkit-1.2.9.tar.gz.

File metadata

  • Download URL: techkit-1.2.9.tar.gz
  • Upload date:
  • Size: 50.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for techkit-1.2.9.tar.gz
Algorithm Hash digest
SHA256 ee706aeb1394929e2446fc2bdf85f79c9d36360a2422167888ed84a8a4386d98
MD5 316f73adf19cf80e87879396e84c54fb
BLAKE2b-256 e81e3621bb55a87b5f63026e0263735e117b875f30d53871c958899c3a3bedd8

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: techkit-1.2.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 305.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for techkit-1.2.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fe307dd29efa95831a2f1ff686c1f019bb5c46b3e61d0b69781bb1ef9f8db915
MD5 b66beb5520d2e35a6cc7c50b80bcc084
BLAKE2b-256 12a809161f8f5db8e8b8ab0cfe3fb17289acefc51d1d6828dadc8730563f75de

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b88fae2838653382082bef6e28957d9a0e0b38b756985e905b32c11a163ffe5d
MD5 ba69542b4e122a33fc925ec0c5fae89a
BLAKE2b-256 cd9b80b16c4d7f494b97743ec4a92806409fce88a307a03620094a84963051f1

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7128e1053fccf79e9cf1bec98b1920e5b1ebf92435510728c09d399fb54374e
MD5 aafebc61d88a9f54a37f034bce5e6296
BLAKE2b-256 cdcb5b22ee02778d003893bc1f8d506b94afa5cc9034dd2b5b4f40902e51f487

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp312-cp312-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ec3babc5894c4fac465a9b50d4b08c9b0c0a8dce5787906f549bbd39eb735dd0
MD5 da1aa20560ebd4472c6f4452bdbb8eb7
BLAKE2b-256 c6e3a9fb6ed730efebf088f0f2d3e825449962edc6b3dd74164cb8f4027afb3f

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: techkit-1.2.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 302.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for techkit-1.2.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b6f516a7a25f6f91f535b01675bddc98fb813f97252ed6fb51b20bf294eda261
MD5 96294ac5e9bc137455a8703e1ae34586
BLAKE2b-256 2b1e07d7730cf63be4edf9ac668f3f7d30dabf907153d3ac459240e240a8bb25

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b9f5b8519a4329066eb2076c1688cdec17190753de29558f2a9cd56002a28b22
MD5 d837e8d7419dab38bf7478c124db902c
BLAKE2b-256 8123a40af73193362f589749e47eb908ef7333f410b5efd5276853be0f94c474

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 592d07c84fe57670c4b6a223a4bd98af7735f21bf97297a881f5624200a26341
MD5 3e8b4202eda3c7e1b6b850c384730763
BLAKE2b-256 2808703de5b215e21ffa883a08d5bbd5fab81b0aacab86892862b2f1b6565384

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fb3368eaea6fa5031234f244f618be7bdb7105e192d100d65a89bc473dcc499d
MD5 5421a5a7c4f567573f1ef5a2e8184756
BLAKE2b-256 110c9db0e6f53b0d14de2eb55381be7baf47eea0734cc48c0338f94e996f8ebe

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: techkit-1.2.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 302.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for techkit-1.2.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 edba7ba2ed3d5989d93f290534c853683c4a5d0114ec86e8d4fb2ea349dd3186
MD5 b19d0fa7faed2c1eca203f88ae01c7a8
BLAKE2b-256 fa5c6b89ff91142e73f9b90387e25a928fce0992917f545c7891488ffebdf054

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4df2c5b6ba674883e83c654d3fce388496a19e076168ae2718d22fcb7707aa6
MD5 6fd5e50501e9de1e7dec0785bd6e11f8
BLAKE2b-256 66e0972ed438022bd6552fae9d6f6d75f2372b0f844a2ea06414e2f7adc93e3b

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df6f375cada3f9b94159e502682bcaa1339e59c48be13c521546b1acefdcc027
MD5 9a9a7c973d7440606a313745374ea968
BLAKE2b-256 48d03aa7b79b52fccf4ee090705556ea19ec1328e14d47cafee3217cbe983ba5

See more details on using hashes here.

File details

Details for the file techkit-1.2.9-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for techkit-1.2.9-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7e8c663992dd2181a068c949097a58744f2f54b8e952fd181430ff4e6535eb37
MD5 57691376d58dd48f839ff8a6f51d1616
BLAKE2b-256 201e2f42ce3be8c5a2da1963b7e61fa7829622c22abbe27956c5ddb67c80fbff

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