TechKit Documentation
High-performance technical analysis library for financial applications.
Welcome to TechKit documentation! TechKit is a modern technical analysis library designed for financial applications, providing high-performance, thread-safe technical indicator calculation capabilities.
What is TechKit?
TechKit is a high-performance, thread-safe technical analysis library designed to replace traditional TA-Lib. It provides 189 technical indicators with support for real-time streaming data processing and batch historical data analysis.
Core Features
189 Technical Indicators - Complete TA-Lib algorithm compatibility plus advanced analytics
High Performance - C++ core implementation with O(1) incremental updates
Cross-Platform Support - Python, Node.js, WebAssembly, and native C/C++
Thread-Safe - Zero global state design, each instance is completely independent
Memory Efficient - O(period) memory footprint, suitable for large-scale data processing
Real-Time Streaming - Supports incremental data updates without waiting for complete datasets
Easy to Use - Clean API design supporting both object-oriented and functional styles
Use Cases
TechKit is suitable for the following scenarios:
Quantitative Trading Research - Quickly calculate large numbers of technical indicators for strategy backtesting
Real-Time Trading Systems - Stream data processing with low-latency indicator calculation
Data Analysis Platforms - Batch process historical data to generate technical analysis reports
Web Applications - Calculate indicators directly in the browser without backend services
Mobile Applications - Lightweight, high-performance mobile technical analysis
Version Information
TechKit provides bindings for multiple languages and platforms, each with potentially different versions:
Python Version
Package Name:
techkitCurrent Version: 1.2.7
Python Requirement: Python 3.10+
Dependencies: NumPy 1.21+
Supported Platforms: Linux (x86_64, aarch64), macOS (x86_64, arm64), Windows (AMD64)
Number of Indicators: 189 (full version)
Installation:
pip install techkit
Node.js Version
TechKit provides two Node.js packages to meet different needs:
techkit (Core Edition)
Package Name:
techkitCurrent Version: 1.2.7
Number of Indicators: 158+ core indicators (TA-Lib compatible)
WASM Size: ~200KB
Features: Lightweight, includes the most commonly used technical indicators
Use Cases: Most application scenarios requiring common indicators
Installation:
npm install techkit
techkit-full (Full Edition)
Package Name:
techkit-fullCurrent Version: 1.2.7
Number of Indicators: 189 (including advanced analytics)
WASM Size: ~800KB
Features: Complete functionality including risk metrics, volatility models, pattern recognition, etc.
Use Cases: Requiring complete functionality, advanced analytics, pattern recognition
Installation:
npm install techkit-full
Version Comparison:
Feature |
techkit |
techkit-full |
|---|---|---|
Core Indicators (TA-Lib) |
✅ 158 |
✅ 158 |
Advanced Analytics |
❌ |
✅ 31 |
Risk Metrics |
❌ |
✅ Sharpe, Sortino, VaR |
Volatility Models |
❌ |
✅ GARCH, EWMA |
Pattern Recognition |
❌ |
✅ Harmonic Patterns, Chart Patterns |
Browser Support |
✅ |
✅ |
Node.js Native |
✅ |
✅ |
Browser Version
Both Node.js packages support browser environments:
techkit: Runs in browser via WebAssembly
techkit-full: Runs in browser via WebAssembly (more complete functionality)
C/C++ Version
Language: C (ABI) + C++11 (implementation)
Build System: CMake
Number of Indicators: 189
Features: Native performance, no dependencies
Quick Start
Select your platform to view the quick start guide:
import techkit as tk
import numpy as np
# Create indicator instances
sma = tk.SMA(period=20) # 20-period Simple Moving Average
rsi = tk.RSI(period=14) # 14-period Relative Strength Index
# Prepare price data (example)
prices = np.array([100.0, 101.5, 102.3, 101.8, 103.2, 104.1, 103.5, 105.0])
# Method 1: Incremental updates (suitable for real-time data streams)
for price in prices:
sma_result = sma.update(price)
rsi_result = rsi.update(price)
# Check if result is valid (indicators need a certain amount of data to calculate)
if sma_result.valid:
print(f"Price: {price:.2f}, SMA: {sma_result.value:.2f}, RSI: {rsi_result.value:.2f}")
# Method 2: Batch calculation (suitable for historical data analysis)
sma_values = tk.SMA(20).calculate(prices)
rsi_values = tk.RSI(14).calculate(prices)
# NaN values indicate insufficient data at that position
print("SMA values:", sma_values)
print("RSI values:", rsi_values)
import { init, SMA, RSI } from 'techkit';
// Initialize (must be called once before use)
await init();
// Create indicator instances
const sma = new SMA(20); // 20-period Simple Moving Average
const rsi = new RSI(14); // 14-period Relative Strength Index
// Prepare price data
const prices = [100.0, 101.5, 102.3, 101.8, 103.2, 104.1, 103.5, 105.0];
// Method 1: Incremental updates (suitable for real-time data streams)
for (const price of prices) {
const smaResult = sma.update(price);
const rsiResult = rsi.update(price);
// Check if result is valid
if (smaResult.valid) {
console.log(`Price: ${price.toFixed(2)}, SMA: ${smaResult.value.toFixed(2)}, RSI: ${rsiResult.value.toFixed(2)}`);
}
}
// Method 2: Batch calculation (suitable for historical data analysis)
const smaValues = sma.calculate(prices);
const rsiValues = rsi.calculate(prices);
console.log('SMA values:', smaValues);
console.log('RSI values:', rsiValues);
// Cleanup resources (important!)
sma.dispose();
rsi.dispose();
#include <techkit/techkit.hpp>
#include <iostream>
#include <vector>
int main() {
// Create indicator instances (RAII - automatic resource management)
auto sma = techkit::Indicator::SMA(20);
auto rsi = techkit::Indicator::RSI(14);
// Prepare price data
std::vector<double> prices = {100.0, 101.5, 102.3, 101.8, 103.2, 104.1, 103.5, 105.0};
// Incremental updates
for (size_t i = 0; i < prices.size(); ++i) {
auto sma_r = sma.update(prices[i]);
auto rsi_r = rsi.update(prices[i]);
if (sma_r.valid) {
std::cout << "Price: " << prices[i]
<< ", SMA: " << sma_r.value
<< ", RSI: " << rsi_r.value << std::endl;
}
}
return 0; // Indicators automatically released
}
Why Choose TechKit?
Advantages Over TA-Lib
Incremental Update Support - TA-Lib only supports batch calculation, TechKit supports O(1) incremental updates suitable for real-time data streams
Thread-Safe - Zero global state, no locking required in multi-threaded environments
Modern API - Object-oriented design, more aligned with modern programming practices
Cross-Platform - Unified API usable in Python, Node.js, browsers, and C++
Complete Documentation - Detailed documentation suitable for beginners
Performance Advantages
C++ Core - Native performance, 10-100x faster than pure Python/JavaScript implementations
Memory Efficient - O(period) memory footprint instead of O(n)
Vectorized Computation - Fully utilizes CPU SIMD instructions during batch calculation
Use Case Examples
Scenario 1: Real-Time Trading System
# Receive real-time price stream, calculate indicators immediately
for price in real_time_price_stream:
rsi_result = rsi.update(price)
if rsi_result.valid and rsi_result.value > 70:
trigger_sell_signal() # RSI overbought, trigger sell signal
Scenario 2: Historical Data Backtesting
# Calculate indicators for all historical data at once
historical_prices = load_from_database()
sma_values = tk.SMA(20).calculate(historical_prices)
rsi_values = tk.RSI(14).calculate(historical_prices)
Scenario 3: Web Application
// Calculate indicators directly in browser without backend
const sma = new SMA(20);
const result = sma.calculate(userPriceData);
updateChart(result);
Complete Table of Contents
Getting Started
API Reference
Indicator Reference
- Indicator Reference
- Overlap Studies
- SMA - Simple Moving Average
- EMA - Exponential Moving Average
- WMA - Weighted Moving Average
- DEMA - Double Exponential Moving Average
- TEMA - Triple Exponential Moving Average
- KAMA - Kaufman Adaptive Moving Average
- TRIMA - Triangular Moving Average
- T3 - Triple Exponential Moving Average (Tilson)
- BBANDS - Bollinger Bands
- SAR - Parabolic Stop and Reverse
- MIDPOINT - MidPoint over Period
- MIDPRICE - Midpoint Price over Period
- MA - Moving Average (Generic)
- MAVP - Moving Average with Variable Period
- MAMA - MESA Adaptive Moving Average
- HT_TRENDLINE - Hilbert Transform Instantaneous Trendline
- SAREXT - Parabolic SAR Extended
- Related Indicators
- Momentum Indicators
- RSI - Relative Strength Index
- MACD - Moving Average Convergence Divergence
- STOCH - Stochastic Oscillator
- ADX - Average Directional Index
- Other Momentum Indicators
- MOM - Momentum
- ROC - Rate of Change
- ROCP - Rate of Change Percentage
- ROCR - Rate of Change Ratio
- ROCR100 - Rate of Change Ratio × 100
- MACDEXT - MACD Extended
- MACDFIX - MACD Fixed 12/26
- STOCHF - Stochastic Fast
- STOCHRSI - Stochastic RSI
- ADXR - Average Directional Index Rating
- DX - Directional Movement Index
- PLUS_DI - Plus Directional Indicator
- MINUS_DI - Minus Directional Indicator
- PLUS_DM - Plus Directional Movement
- MINUS_DM - Minus Directional Movement
- CCI - Commodity Channel Index
- CMO - Chande Momentum Oscillator
- MFI - Money Flow Index
- WILLR - Williams %R
- APO - Absolute Price Oscillator
- PPO - Percentage Price Oscillator
- TRIX - Triple Smooth EMA Rate of Change
- ULTOSC - Ultimate Oscillator
- AROON - Aroon Indicator
- AROONOSC - Aroon Oscillator
- BOP - Balance of Power
- Volatility Indicators
- Volume Indicators
- Statistical Functions
- STDDEV - Standard Deviation
- VAR - Variance
- Linear Regression Functions
- LINEARREG - Linear Regression
- LINEARREG_SLOPE - Linear Regression Slope
- LINEARREG_INTERCEPT - Linear Regression Intercept
- LINEARREG_ANGLE - Linear Regression Angle
- TSF - Time Series Forecast
- BETA - Beta Coefficient
- CORREL - Pearson Correlation
- Statistical Functions Summary
- Related Indicators
- Candlestick Pattern Recognition
- Single Candle Patterns
- CDLDOJI - Doji
- CDLDOJISTAR - Doji Star
- CDLDRAGONFLYDOJI - Dragonfly Doji
- CDLGRAVESTONEDOJI - Gravestone Doji
- CDLLONGLEGGEDDOJI - Long-Legged Doji
- CDLRICKSHAWMAN - Rickshaw Man
- CDLHAMMER - Hammer
- CDLHANGINGMAN - Hanging Man
- CDLINVERTEDHAMMER - Inverted Hammer
- CDLSHOOTINGSTAR - Shooting Star
- CDLMARUBOZU - Marubozu
- CDLLONGLINE - Long Line Candle
- CDLSHORTLINE - Short Line Candle
- CDLSPINNINGTOP - Spinning Top
- CDLHIGHWAVE - High Wave Candle
- CDLTAKURI - Takuri (Dragonfly Doji with longer shadow)
- Two Candle Patterns
- CDLENGULFING - Engulfing Pattern
- CDLHARAMI - Harami Pattern
- CDLHARAMICROSS - Harami Cross
- CDLPIERCING - Piercing Pattern
- CDLDARKCLOUDCOVER - Dark Cloud Cover
- CDLBELTHOLD - Belt Hold
- CDLCOUNTERATTACK - Counterattack Lines
- CDLHIKKAKE - Hikkake Pattern
- CDLHIKKAKEMOD - Modified Hikkake
- CDLHOMINGPIGEON - Homing Pigeon
- CDLINNECK - In Neck Pattern
- CDLONNECK - On Neck Pattern
- CDLKICKING - Kicking Pattern
- CDLKICKINGBYLENGTH - Kicking by Length
- CDLMATCHINGLOW - Matching Low
- CDLTHRUSTING - Thrusting Pattern
- CDL2CROWS - Two Crows
- Three or More Candle Patterns
- CDLMORNINGSTAR - Morning Star
- CDLEVENINGSTAR - Evening Star
- CDLMORNINGDOJISTAR - Morning Doji Star
- CDLEVENINGDOJISTAR - Evening Doji Star
- CDL3WHITESOLDIERS - Three White Soldiers
- CDL3BLACKCROWS - Three Black Crows
- CDL3INSIDE - Three Inside Up/Down
- CDL3OUTSIDE - Three Outside Up/Down
- CDL3LINESTRIKE - Three Line Strike
- CDL3STARSINSOUTH - Three Stars in the South
- CDLABANDONEDBABY - Abandoned Baby
- CDLADVANCEBLOCK - Advance Block
- CDLBREAKAWAY - Breakaway Pattern
- CDLCONCEALBABYSWALL - Concealing Baby Swallow
- CDLGAPSIDESIDEWHITE - Up/Down Gap Side-by-Side White Lines
- CDLIDENTICAL3CROWS - Identical Three Crows
- CDLLADDERBOTTOM - Ladder Bottom
- CDLMATHOLD - Mat Hold
- CDLRISEFALL3METHODS - Rising/Falling Three Methods
- CDLSEPARATINGLINES - Separating Lines
- CDLSTALLEDPATTERN - Stalled Pattern
- CDLSTICKSANDWICH - Stick Sandwich
- CDLTASUKIGAP - Tasuki Gap
- CDLTRISTAR - Tri-Star
- CDLUNIQUE3RIVER - Unique Three River Bottom
- CDLUPSIDEGAP2CROWS - Upside Gap Two Crows
- CDLXSIDEGAP3METHODS - Upside/Downside Gap Three Methods
- Pattern Summary Table
- Pattern Scanning
- Advanced Indicators
Contact
Indices and Search
Index - Complete index
Search Page - Search documentation
Get Help
Documentation Site: https://techkit-docs.netlify.app/
GitHub Repository: https://github.com/yiivon/techkit
Issue Tracker: GitHub Issues
Version Information
Documentation Version: 1.2.7
Last Updated: 2024-12
License: MIT License