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

📖 API Documentation

Full API documentation: techkit-docs.netlify.app/en/api/python-api/


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.8.tar.gz (50.5 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.8-cp312-cp312-win_amd64.whl (305.3 kB view details)

Uploaded CPython 3.12Windows x86-64

techkit-1.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

techkit-1.2.8-cp312-cp312-macosx_11_0_arm64.whl (304.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

techkit-1.2.8-cp312-cp312-macosx_10_14_x86_64.whl (343.8 kB view details)

Uploaded CPython 3.12macOS 10.14+ x86-64

techkit-1.2.8-cp311-cp311-win_amd64.whl (302.3 kB view details)

Uploaded CPython 3.11Windows x86-64

techkit-1.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (448.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

techkit-1.2.8-cp311-cp311-macosx_11_0_arm64.whl (304.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

techkit-1.2.8-cp311-cp311-macosx_10_14_x86_64.whl (337.8 kB view details)

Uploaded CPython 3.11macOS 10.14+ x86-64

techkit-1.2.8-cp310-cp310-win_amd64.whl (302.3 kB view details)

Uploaded CPython 3.10Windows x86-64

techkit-1.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

techkit-1.2.8-cp310-cp310-macosx_11_0_arm64.whl (302.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

techkit-1.2.8-cp310-cp310-macosx_10_14_x86_64.whl (336.3 kB view details)

Uploaded CPython 3.10macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: techkit-1.2.8.tar.gz
  • Upload date:
  • Size: 50.5 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.8.tar.gz
Algorithm Hash digest
SHA256 ff0488d1622cc13797f320d67f36deb8061cf4350323a6e4e45084abcea15770
MD5 736f201620ee2aaf357565ae5ff415ac
BLAKE2b-256 c444e4d7b36c1d5c66fec38a0122077b0de473104fa5eb4a68a30145f3de78a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: techkit-1.2.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 305.3 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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ad479dfdf46539b82148884e88a58ab478539a89801871f8899a677840ec17d3
MD5 cf118967a185a6c731dde471d31f1873
BLAKE2b-256 7020197f170eb09b280f1bbf47eda7b17c23d8445b17f675a3f712261fd4f1b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7cce213fab544f988d07fb3ef566e1bc75e5801dd8286baff5f484734ab1d31
MD5 4d46b1fc622c6db94cc0f0ff460a7236
BLAKE2b-256 a392aef075074afcbe7a99c41f18cf33dff12730fba16a5c4f3bd15122839eff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ad127f54cb9e2fb53e45fd25303e402396815ed88583a6b3a52e28d64725978
MD5 55c2484a549eaf905f2ee7896a73e86e
BLAKE2b-256 3d1d7ef0278c8c53fd896c31a2586f400d520fc1a1c016a002a2f1048a79e876

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 82b406b0c0528d0e314c2387a9e861d8673bb330b3fef567af7c19d0cded82d4
MD5 95dc32c986de5f4457feff0bae68bb2b
BLAKE2b-256 9f099c7a22e905e2e63c80c1af28bd104f2095ee7989050c531fce1606be16ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: techkit-1.2.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 302.3 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.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 43d9941cbd438e77d301be949d0825312173694c7872d45d0713b3c9ea5d5005
MD5 af6795d9bfb93d160e770dff0adfdf2f
BLAKE2b-256 0d83f9e7d2a5016e37122d5a2782341e3f7d7f82a756e9eae6f1ba7cddb08ca2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c8e1d523695f931ed2fcecfc1d64627f3c6bfebc705a90192cb95e87d9ea478
MD5 f63761634130dfbdeb41ff6311f3353f
BLAKE2b-256 55208a7d2ff51ba146ffe7305013a776f8730c01d971f6b01d4a71302e69dd01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f56254218fd79e6faf151b43c92836e956a9ac5145b5a2e42948479cdd07fbab
MD5 db3c5f1340ef44dfb7c32d72b1113830
BLAKE2b-256 7edaef3a69de7c6853a1d58f8dd59d536a3719c5de82d73fa6e7e2a90b258f86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 787aefc15e93b3ae48d3b861acc4510052a6db6317339315e70b44ca75b6a463
MD5 77f6c67271a85917a6a04ab26cbc1852
BLAKE2b-256 6b2e131d3f20dbcbc9ee14850d34acd4046725d0960db197246cf3ccabf81fe2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: techkit-1.2.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 302.3 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.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c2999815f539de97223c1125520204d7be658fa616b39442c5955bf5d44e967c
MD5 7e995d3b4b3203e3b83a30e21cc9297a
BLAKE2b-256 9473ed211c9271cea832a31d36e32469bbffa61a237250c25e3f7a5c805bfc63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09d4e3fa314350f15c56b7c97c27cbc67a2fb147466a124a0cb01601daa5a14a
MD5 de55f49524c558e176a5081f52ff3545
BLAKE2b-256 f4f16320d5de2562cefedafd971563d7498c97633ee8e337341f697a5f72cc96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38a077f7f6b06b3135edfcda65a3dcf27db41a60e1fb9b4255768ee97cd8b249
MD5 c205b476e810f5ef0ae0aa0c8405526c
BLAKE2b-256 ccbb1485da2cd44655dbc1c329ca3f9c83aea06ef3ede29fa81b62928d2702c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for techkit-1.2.8-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5c14db6ab5d6bf85ce5bf4ce2495cb2284e1b877cd4af129651b7e5ad1b04b8d
MD5 9be6c0c72838f67cc4cbe2d10120d8a9
BLAKE2b-256 8ab9634825c1f47df3ed645b246f5b159b4eb6a9d6e13d6df0c7963a52509bd3

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