Skip to main content

A lightweight, production-ready Python library for computing core financial technical indicators such as SMA, EMA, and RSI using numerically stable and vectorized pandas operations. Designed for quantitative research, algorithmic trading, and machine learning pipelines.

Project description

finind ๐Ÿ“Š

finind ๐Ÿ“Š

PyPI version Python GitHub GitHub stars

A lightweight, fast, and clean financial indicators & signal generation library built on top of pandas.

Designed for:

  • Quant research
  • Trading systems
  • Streamlit dashboards
  • Backtesting pipelines

๐Ÿ“œ Changelog

See full version history in CHANGELOG.md


๐Ÿš€ Features

๐Ÿ“ˆ Indicators

  • SMA (Simple Moving Average)
  • EMA (Exponential Moving Average)
  • RSI (Wilderโ€™s method)
  • ATR (Average True Range)

๐Ÿ” Crossover Signals

  • Golden Cross (e.g., 50/200)
  • Death Cross
  • Generic crossover detection

๐Ÿ“Š Price Structure Signals

  • Higher Highs (HH)
  • Lower Lows (LL)
  • Swing High / Swing Low detection

โšก Momentum Signals

  • RSI Overbought / Oversold
  • MACD Bullish / Bearish Crossovers

๐Ÿ†• What's New (v0.2.1)

  • Added ATR indicator
  • Added Higher High / Lower Low detection
  • Added Swing High / Swing Low logic
  • Added MACD crossover signals
  • Improved crossover alignment logic
  • Cleaner boolean signal outputs

๐Ÿ“ฆ Installation

pip install finind

๐Ÿง  Quick Example

import pandas as pd
import yfinance as yf

from finind import sma, ema, rsi, atr
from finind.signals import (
    golden_cross, higher_highs, lower_lows,
    rsi_signal, macd_crossover
)

# Fetch data
df = yf.download("^NSEI", start="2022-01-01")

# Indicators
df["SMA20"] = sma(df, 20)
df["EMA20"] = ema(df, 20)
df["RSI14"] = rsi(df, 14)
df["ATR14"] = atr(df["High"], df["Low"], df["Close"])

# Signals
df["GoldenCross"] = golden_cross(df, 50, 200)
df["HigherHigh"] = higher_highs(df["Close"])
df["LowerLow"] = lower_lows(df["Close"])

rsi_flags = rsi_signal(df["RSI"])

# Example MACD (user computes MACD first)
df["EMA12"] = ema(df, 12)
df["EMA26"] = ema(df, 26)
df["MACD"] = df["EMA12"] - df["EMA26"]
df["Signal"] = ema(df["MACD"], 9)

macd_flags = macd_crossover(df["MACD"], df["Signal"])

df = pd.concat([df, rsi_flags, macd_flags], axis=1)

print(df.tail())

๐Ÿ” Indicator Details

๐Ÿ“Š SMA

sma(df, 20)

๐Ÿ“Š EMA

ema(df, 20)

๐Ÿ“Š RSI (Wilder)

rsi(df, 14)
df["RSI14"] = rsi(df, 14)
df["RSI25"] = rsi(df, 25)

๐Ÿ“Š ATR

atr(df["High"], df["Low"], df["Close"], period=14)
df["ATR14"] = atr(df["High"], df["Low"], df["Close"], 14)

Measures volatility using True Range with Wilder smoothing.


๐Ÿ” Signal Details

๐Ÿ” Golden Cross

golden_cross(df, 50, 200)

โœ” Short-term SMA crosses above long-term SMA


๐Ÿ“‰ Death Cross

death_cross(df, 50, 200)

โœ” Short-term SMA crosses below long-term SMA


๐Ÿ“ˆ Higher Highs

higher_highs(df["Close"], window=3)

โœ” Detects trend continuation using swing highs


๐Ÿ“‰ Lower Lows

lower_lows(df["Close"], window=3)

โœ” Detects downtrend continuation using swing lows


๐Ÿ”ฅ RSI Signals

rsi_signal(df["RSI"], overbought=70, oversold=30)

Returns:

  • rsi_overbought
  • rsi_oversold

โšก MACD Crossovers

from finind import ema
from finind.signals import macd_crossover

# Step 1: MACD
df["EMA12"] = ema(df, 12)
df["EMA26"] = ema(df, 26)
df["MACD"] = df["EMA12"] - df["EMA26"]

# Step 2: Signal line
df["Signal"] = ema(df["MACD"], 9)

# Step 3: Crossovers
macd_signals = macd_crossover(df["MACD"], df["Signal"])

df = pd.concat([df, macd_signals], axis=1)

Returns:

  • macd_bullish
  • macd_bearish

๐Ÿงฉ Design Philosophy

  • โœ… Works directly with pandas Series / DataFrames
  • โœ… Minimal dependencies
  • โœ… Clean boolean outputs for easy backtesting
  • โœ… No black-box logic
  • โœ… Fully vectorized (fast)

๐Ÿ“œ Version History

v0.2.0

  • Added ATR indicator
  • Added Higher High / Lower Low detection
  • Added MACD crossover signals
  • Improved crossover logic

v0.1.0

  • Initial release
  • SMA, EMA, RSI
  • Golden / Death cross

โš ๏ธ Disclaimer

This library is for educational and research purposes only. Not financial advice.


๐Ÿ”ฅ Roadmap

  • MACD (full indicator)
  • Bollinger Bands
  • ADX / Trend strength indicators
  • Volume indicators (OBV, VWAP)
  • Multi-timeframe support

โญ Support

If you find this project useful:

  • โญ Star the repo on GitHub
  • ๐Ÿ› Report issues
  • ๐Ÿค Contribute improvements

It helps the project grow and reach more developers ๐Ÿš€

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

finind-0.2.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

finind-0.2.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file finind-0.2.1.tar.gz.

File metadata

  • Download URL: finind-0.2.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for finind-0.2.1.tar.gz
Algorithm Hash digest
SHA256 175e93dbdc4ecad3f8ed02136e37364209749cec6f65dd54836e4556bb6f1cf2
MD5 48c445b951fae0267e9919f98f554bab
BLAKE2b-256 048a8cddf3fe886caa826b943e0ed4804b2a72c31a4548998631f22e3296d431

See more details on using hashes here.

File details

Details for the file finind-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: finind-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for finind-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 928ab7c3b2aa7c9cac27e6f691a58e67695cf409f1a6de07cace6020b6a0c80b
MD5 6bfe869021009cb6758c6e1c0fde326a
BLAKE2b-256 1ae7452af66c2992a8ac135960bef660a11713a53278d6523616ec950411bdd0

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