Metadata-Version: 2.4
Name: wael-lib
Version: 1.0.0
Summary: Technical Analysis, Data Handling & Sequence Utilities for Trading Applications
Author: Wael Fouda
License: MIT
Project-URL: Homepage, https://github.com/WaelFouda/wael-lib
Project-URL: Repository, https://github.com/WaelFouda/wael-lib
Project-URL: Issues, https://github.com/WaelFouda/wael-lib/issues
Keywords: trading,technical-analysis,finance,indicators,sequences,lstm
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: scikit-learn>=1.3.0
Dynamic: license-file

# wael-lib

Technical Analysis, Data Handling & Sequence Utilities for Trading Applications.

## Installation

```bash
pip install git+https://github.com/WaelFouda/wael-lib.git
```

## Classes

### `TechAnalysis`
30+ technical indicators and pattern detection:
- **Moving Averages**: SMA, EMA, WMA, TEMA
- **Oscillators**: RSI, Stochastic, MFI, ADX, MACD, TEMA MACD, Price Extension Oscillator
- **Volatility**: ATR, Standard Deviation
- **Utilities**: Highest, Lowest, Change, BarsSince, ValueWhen, Math helpers
- **Pivot Points**: Pivot High/Low with configurable left/right bars
- **Trend Detection**: Rolling window extremes, Uptrend/Downtrend/Sideways classification
- **Structure Analysis**: BOS (Break of Structure) & CHoCH (Change of Character) detection
- **Chart Formations**: Head & Shoulders, Double Top/Bottom, Triangles (continuation & reversal)
- **Candlestick Patterns**: 12 patterns (Engulfing, Hammer, Doji, Three Soldiers/Crows, etc.)

### `WDataHandler`
- IQR-based outlier clipping
- Empirical Cumulative Distribution Function (ECDF)

### `SequenceCreator`
- Sliding window sequence creation for LSTM/GRU models
- Supports univariate and multivariate time series
- Configurable window size and prediction horizon

### `SequenceScaler` / `MySequenceScaler`
- sklearn-compatible transformers for 3D sequence data
- MinMaxScaler (SequenceScaler) and StandardScaler (MySequenceScaler) variants
- Pipeline-ready with `fit()` / `transform()` interface

## Quick Start

```python
from wael_lib import TechAnalysis, SequenceCreator, SequenceScaler

ta = TechAnalysis()

# Calculate indicators
rsi = ta.rsi(df['Close'], 14)
macd_line, signal, histogram = ta.macd(df['Close'])
trend = ta.detect_trend(df, row_index, tops, bottoms)
pattern = ta.detect_candlestick_pattern(df, row_index)

# Create sequences for LSTM
seq = SequenceCreator(window=30, horizon=1)
X_seq, y_seq = seq.create_sequences(X_features, y_target)

# Scale sequences
scaler = SequenceScaler()
X_scaled = scaler.fit_transform(X_seq)
```

## Dependencies

- pandas >= 2.0.0
- numpy >= 1.24.0
- scikit-learn >= 1.3.0

## License

MIT
