Skip to main content

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

Project description

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

Links

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

pyalbedo-0.0.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

pyalbedo-0.0.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file pyalbedo-0.0.1.tar.gz.

File metadata

  • Download URL: pyalbedo-0.0.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pyalbedo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c7585f46466e06b28677cf1eca83b074ccdb5b0225557262f2f4f1524eb78eb1
MD5 7364dce6b8ffc6f03c26af60ef7ae532
BLAKE2b-256 742588297694d3ec310f667b0652b746fbaad2b4e29aced0558fd1a0a8ac732e

See more details on using hashes here.

File details

Details for the file pyalbedo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyalbedo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pyalbedo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 346078fe7c995272c68d9712a47329d4ce83d45e8b987784f9c0c4b0c54eeebd
MD5 9ba48fe9e2c25f4e4fd0bb25bac06f54
BLAKE2b-256 3d0242f947a4f60abc63f9b5823e92a8b058062b29619e36d71acd00636c0df4

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