ATR-adaptive Laguerre RSI for non-anticipative feature engineering in seq-2-seq forecasting
Project description
ATR-Adaptive Laguerre RSI
Non-anticipative volatility-adaptive momentum indicator for sequence-to-sequence forecasting.
Overview
This library implements the ATR-Adaptive Laguerre RSI indicator, designed for robust feature engineering in financial time series forecasting. The indicator combines:
- True Range (TR) - Volatility measurement including gaps
- ATR with Min/Max Tracking - Rolling volatility envelope
- Adaptive Coefficient - Volatility-normalized adaptation
- Laguerre 4-Stage Cascade - Low-lag smoothing filter
- Laguerre RSI - Momentum from filter stage differences
Key Features
- ✅ Non-anticipative: Guaranteed no lookahead bias
- ✅ O(1) Incremental: Efficient streaming updates with
.update()method - ✅ Multi-interval: Supports 1s-1d timeframes with 121-feature extraction
- ✅ Flexible datetime: Works with DatetimeIndex, 'date' column, or custom column names
- ✅ Validated: Information coefficient > 0.03 on k-step-ahead returns
Installation
uv add atr-adaptive-laguerre
Quick Start
Basic Usage (Single RSI Value)
from atr_adaptive_laguerre import ATRAdaptiveLaguerreRSI, ATRAdaptiveLaguerreRSIConfig
import pandas as pd
# Create indicator with flexible datetime support
config = ATRAdaptiveLaguerreRSIConfig(
atr_period=14,
smoothing_period=5,
date_column='date' # Or use DatetimeIndex
)
indicator = ATRAdaptiveLaguerreRSI(config)
# Batch processing
rsi_series = indicator.fit_transform(df) # Returns pd.Series
# Incremental updates (O(1) streaming)
new_row = {'open': 100, 'high': 101, 'low': 99, 'close': 100.5, 'volume': 1000}
new_rsi = indicator.update(new_row) # Returns float
Multi-Interval Feature Extraction (121 Features)
# Extract features across 3 intervals (5m, 15m, 1h example)
config = ATRAdaptiveLaguerreRSIConfig(
atr_period=14,
smoothing_period=5,
multiplier_1=3, # 15m features (5m × 3)
multiplier_2=12 # 1h features (5m × 12)
)
feature = ATRAdaptiveLaguerreRSI(config)
# Returns DataFrame with 121 columns:
# - 27 base interval features (*_base)
# - 27 mult1 interval features (*_mult1)
# - 27 mult2 interval features (*_mult2)
# - 40 cross-interval interactions
features_df = feature.fit_transform_features(df)
# Check minimum required data
print(f"Need {feature.min_lookback_base_interval} bars for multi-interval")
Documentation
- API Reference - Complete API documentation
- Examples - Runnable usage examples
- Changelog - Release notes and version history
License
MIT License - Eon Labs Ltd.
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 atr_adaptive_laguerre-0.2.1.tar.gz.
File metadata
- Download URL: atr_adaptive_laguerre-0.2.1.tar.gz
- Upload date:
- Size: 233.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fe600c533bb598a4dbb10f0482f663778ede1ec08f343e291b547ffcfb14452
|
|
| MD5 |
313817d270c791aae1740a8e0fb955e8
|
|
| BLAKE2b-256 |
c1d7b64876d2033a2d9ee6ff0ab73e15e3f17ace4f8b1999c3abbd721e16ce41
|
File details
Details for the file atr_adaptive_laguerre-0.2.1-py3-none-any.whl.
File metadata
- Download URL: atr_adaptive_laguerre-0.2.1-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37c1c738baee356240a600a5460ab448b22c493f07ea6a2f2350cb177abff2ce
|
|
| MD5 |
daf88a770c40a004859465ce18c3904a
|
|
| BLAKE2b-256 |
271a9ac22ca3aa7ecd90767d9a923b46d3005c4942ba8778a4eb9591424ec013
|