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 ๐
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_overboughtrsi_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_bullishmacd_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
175e93dbdc4ecad3f8ed02136e37364209749cec6f65dd54836e4556bb6f1cf2
|
|
| MD5 |
48c445b951fae0267e9919f98f554bab
|
|
| BLAKE2b-256 |
048a8cddf3fe886caa826b943e0ed4804b2a72c31a4548998631f22e3296d431
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
928ab7c3b2aa7c9cac27e6f691a58e67695cf409f1a6de07cace6020b6a0c80b
|
|
| MD5 |
6bfe869021009cb6758c6e1c0fde326a
|
|
| BLAKE2b-256 |
1ae7452af66c2992a8ac135960bef660a11713a53278d6523616ec950411bdd0
|