Skip to main content

A Python library for technical indicator calculations, optimized with Numba for high performance.

Project description

Indikator

CI codecov PyPI Python License

High-Performance Technical Indicators for Python

indikator is a powerful, type-safe Python library for financial market analysis. It provides a comprehensive suite of technical indicators optimized with Numba for high performance, validated with validated, and configurable via nonfig.

Key Features

  • 🚀 High Performance: Critical calculations are JIT-compiled using Numba for near-C speeds.
  • 🛡️ Type-Safe & Validated: Built with strict type checking (basedpyright) and runtime data validation (validated).
  • ⚙️ Configurable: Flexible parameter management using nonfig's hierarchical configuration system.
  • 🐼 Pandas Integration: Seamlessly works with pandas DataFrames and Series.
  • 📦 Modern Stack: Managed with uv, linted with ruff, and tested with pytest.

Installation

Install using pip or uv:

pip install indikator
# or
uv add indikator

Usage

Basic Usage

Indicators can be used directly as functions. They validate input data automatically.

import pandas as pd
from indikator import atr

# Load your OHLCV data
data = pd.DataFrame({
    'high': [...],
    'low': [...],
    'close': [...]
})

# Calculate ATR with default parameters (window=14)
result = atr(data)

# Result is a DataFrame with 'atr' and 'true_range' columns
print(result.head())

Configuration

You can override parameters directly or create reusable configurations using .make().

# 1. Direct override
result = atr(data, window=20)

# 2. Reusable configuration (Factory pattern)
# Create a specialized ATR calculator
fast_atr = atr.Config(window=5).make()

# Apply it to multiple datasets
result1 = fast_atr(data1)
result2 = fast_atr(data2)

Validation

indikator ensures your data is correct before calculation. It checks for:

  • Required columns (e.g., 'high', 'low', 'close')
  • Data types (numeric)
  • Data quality (non-empty, non-NaN where required)
# This will raise a helpful error if 'high' column is missing
try:
    atr(data[['close', 'low']])
except ValueError as e:
    print(f"Validation Error: {e}")

Available Indicators

Indicator Description
ATR Average True Range (Volatility) (Standard & Intraday)
Bollinger Bands Volatility bands based on SMA and standard deviation
Churn Factor Volume efficiency measure
Legs Zigzag/Swing point detection
MACD Moving Average Convergence Divergence
MFI Money Flow Index (Volume-weighted RSI)
OBV On-Balance Volume
Opening Range High/Low of the first N minutes
Pivots Support/Resistance pivot points
RSI Relative Strength Index
RVOL Relative Volume (Standard & Intraday)
Sector Correlation Correlation with a benchmark/sector
Slope Linear regression slope
VWAP Volume Weighted Average Price (Standard & Anchored)
Z-Score Standard deviation from mean (Standard & Intraday)

Development

This project uses uv for dependency management and poe for task running.

Setup

  1. Install uv:
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Clone and sync:
    git clone https://github.com/yourusername/indikator.git
    cd indikator
    uv sync
    
  3. Install pre-commit hooks:
    uv run pre-commit install
    

Common Tasks

  • Test: uv run pytest
  • Lint: uv run ruff check
  • Format: uv run ruff format
  • Type Check: uv run basedpyright
  • Run All Checks: uv run poe quality
  • Generate Docs: uv run poe docs

License

MIT License. See LICENSE for details.

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

indikator-0.2.0.tar.gz (173.4 kB view details)

Uploaded Source

Built Distribution

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

indikator-0.2.0-py3-none-any.whl (231.5 kB view details)

Uploaded Python 3

File details

Details for the file indikator-0.2.0.tar.gz.

File metadata

  • Download URL: indikator-0.2.0.tar.gz
  • Upload date:
  • Size: 173.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for indikator-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c019fe8d70c35cdc8a5ffc55947d889425fe7ed795f2c2f45636dad74a1b486
MD5 774331d57f26e190eda09e54f9c1bf30
BLAKE2b-256 1dfe9f36e665f14cf7835fb85d7863ef2a82db95e6cc06da6e780cb4ec1fa04e

See more details on using hashes here.

File details

Details for the file indikator-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: indikator-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 231.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for indikator-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2cb2118f6b3393f1c5416b479b0de28f86abfd43996c4cc8f5643b009a3921f
MD5 fa0d99409abb2444ed233e4e664ce33e
BLAKE2b-256 7ee08a62bbd902a3bfc8bd5df35c1f50e2cbb56e40e02787b91c15be127b0a18

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