Screamer#

Screamer computes rolling statistics, technical indicators, and signal filters on time series. The same functions run on NumPy arrays and on live streams.

pip install screamer
License Python Versions Tests Documentation PyPI

A short example#

The example below fits a line to each sliding window of 50 values and returns its slope, then takes the sign of the slope to give the trend direction (up or down).

 from screamer import RollingPoly2, Sign

 slope = RollingPoly2(window_size=50, derivative_order=1)
 sign = Sign()

 result = sign(slope(data))

The plot shows the input data (top, blue), the slope over the previous 50 samples (middle, orange), and the sign of the slope (bottom, red).

Speed#

screamer runs batch operations as fast as or faster than NumPy and pandas, and many times faster for rolling-window statistics, because each function updates in constant time per sample. See the Performance page for the full breakdown.

screamer speedup versus the fastest alternative

Causal and deployable#

Every function is causal: its output depends only on current and past inputs, which eliminates look-ahead bias. Code that runs on stored data can be deployed to production against a live feed without changes, because the same C++ implementation handles both.

For a step-by-step walkthrough see the User Guide.

Statistics

Central tendency, dispersion, quantiles, moments, and correlation.

Statistics
Smoothing & filters

Moving averages and designed filters.

Smoothing & filters
Technical indicators

Trend, momentum, bands, volume, and returns.

Technical indicators
Market microstructure

Trade signing, imbalance, price impact, and arrivals.

Market microstructure
Backtesting & risk

Costed equity curves, drawdown, and performance.

Backtesting & risk
Math & logic

Elementwise numeric, trigonometric, activation, and boolean operations.

Math & logic
Data preparation

Fill or drop missing values, and despike outliers.

Data preparation
Streaming & pipelines

Align and reshape event streams, and build a runnable pipeline.

Streaming & pipelines
Examples

Runnable notebooks grouped by task.

Examples