Technical Analysis, Data Handling & Sequence Utilities for Trading Applications
Project description
wael-lib
Technical Analysis, Data Handling & Sequence Utilities for Trading Applications.
Installation
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
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
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
wael_lib-1.0.0.tar.gz
(11.4 kB
view details)
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
wael_lib-1.0.0-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file wael_lib-1.0.0.tar.gz.
File metadata
- Download URL: wael_lib-1.0.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aca061b34163c9dc9447cff2463b3cb9a17b5572ad421b176633308adf19ea81
|
|
| MD5 |
70c73f98a667d20e78113b799ded8658
|
|
| BLAKE2b-256 |
4be463ec3c5b1d1865bd8ec165f298c438ce2c286424bd3f88aec58968a84766
|
File details
Details for the file wael_lib-1.0.0-py3-none-any.whl.
File metadata
- Download URL: wael_lib-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad928945b8834d26e4e66183f09ea1bb19b142707b71ca406fcc11ccdecee4cc
|
|
| MD5 |
abb50b55e7fafdddf5b9689ac402223c
|
|
| BLAKE2b-256 |
be5cadcd6f2438aa738bed8c48d3cb7a81334aa09319888a2def0155a88d170d
|