Skip to main content

PyAlbedo

Transform raw market data into indicators and trading signals—no decisions, no orders.

PyAlbedo is a minimal-dependency Python library that answers one question: "What does the data suggest right now?" It provides pure mathematical indicators (EMA, RSI, MACD, Bollinger Bands, ATR, etc.) and signal generators (crossover, mean reversion, breakout) that interpret those indicators and emit structured signals. It does not handle position sizing, order generation, persistence, or market data fetching—that stays in your strategy and execution layers.

Installation

pip install pyalbedo

With optional dependencies:

pip install pyalbedo[dev]   # pytest, hypothesis, ruff, mypy
pip install pyalbedo[pandas] # DataFrame helpers (future)

Quick example

import numpy as np
from pyalbedo import MarketDataWindow, EMA, RSI
from pyalbedo.signals import MACrossover, RSIMeanReversion, SignalAggregator

# Build a window from arrays (e.g. from your data source)
close = np.random.rand(200) * 100 + 100
high = close + np.random.rand(200) * 2
low = close - np.random.rand(200) * 2
open_ = np.roll(close, 1)
open_[0] = close[0]
volume = np.random.rand(200) * 1e6

window = MarketDataWindow.from_arrays(
    symbol="AAPL",
    open_=open_, high=high, low=low, close=close,
    volume=volume,
)

# Indicators: pure transformations
ema_fast = EMA(period=12)
ema_slow = EMA(period=26)
fast = ema_fast.calculate(close)
slow = ema_slow.calculate(close)

rsi = RSI(period=14)
rsi_series = rsi.calculate(close)

# Signal generators: interpret and emit
ma_cross = MACrossover(fast_period=12, slow_period=26)
rsi_reversion = RSIMeanReversion(period=14, oversold=30, overbought=70)
aggregator = SignalAggregator([ma_cross, rsi_reversion])

bundle = aggregator.generate(window)
if bundle and bundle.signals:
    for s in bundle.signals:
        print(f"{s.source}: {s.direction} strength={s.strength:.2f}")

Indicator groups

  • Moving averages: SMA, EMA, WMA, DEMA, TEMA, Hull MA
  • Oscillators: RSI, Stochastic (%K/%D), MACD, CCI, Williams %R, Ultimate Oscillator, ROC
  • Volatility: ATR, Bollinger Bands, Keltner Channels
  • Volume: OBV, VWAP, MFI, VWMA
  • Trend: ADX (+DI/-DI), Aroon, Supertrend

Signal types

  • Crossover: MA crossover, MACD crossover, Stochastic crossover
  • Mean reversion: RSI oversold/overbought, Bollinger bands, CCI
  • Breakout: ATR-based breakout, Bollinger squeeze/expansion
  • Composite: SignalAggregator runs multiple generators and returns a SignalBundle

What's out of scope

Concern Why excluded
Position sizing Risk management; depends on portfolio state
Order generation Execution; depends on broker
Signal filtering by position Strategy logic, not signal logic
Persistence Signals are ephemeral; persist in your layer
Market data fetching This package receives data; it doesn't fetch it

Metadata

Release files for pyalbedo 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyalbedo 0.0.1
File Size Uploaded Provenance Actions
pyalbedo-0.0.1.tar.gz 18.4 kB Without provenance Details for pyalbedo-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyalbedo 0.0.1
File Interpreter ABI Platform Actions
pyalbedo-0.0.1-py3-none-any.whl Python 3 none any Details for pyalbedo-0.0.1-py3-none-any.whl

Total release size: 41.7 kB

Release files / pyalbedo-0.0.1.tar.gz

Download URL pyalbedo-0.0.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c7585f46466e06b28677cf1eca83b074ccdb5b0225557262f2f4f1524eb78eb1
BLAKE2b-256 checksum
How to use checksums
742588297694d3ec310f667b0652b746fbaad2b4e29aced0558fd1a0a8ac732e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / pyalbedo-0.0.1-py3-none-any.whl

Download URL pyalbedo-0.0.1-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
346078fe7c995272c68d9712a47329d4ce83d45e8b987784f9c0c4b0c54eeebd
BLAKE2b-256 checksum
How to use checksums
3d0242f947a4f60abc63f9b5823e92a8b058062b29619e36d71acd00636c0df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for pyalbedo 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page