A Python project for detecting W (double-bottom) stock price patterns using rule-based technical analysis, with optional machine learning experiments.
This repo is focused on research and experimentation, not live trading.
The goal of this project is to:
- Systematically define and detect W patterns in historical stock data
- Scan large universes (e.g. S&P 500, Nasdaq)
- Study pattern frequency and post-pattern outcomes
- Experiment with ML models on top of rule-based detection
- Rule-based W pattern detection
- Batch scans across stock universes
- Multiple experiment phases (formation-only, outcome-labeled, stricter rules)
- CSV exports and chart visualizations
- Optional ML workflows (feature engineering, classification)
wPattern/
├── rules1.py # Core W-pattern rules
├── phase1_formation_only/
├── phase2_with_outcomes/
├── strict_w_patterns/
├── sp500_scans/
├── training_data/
├── yfML/
└── plots / csv exports
- Historical OHLCV data pulled via yfinance
- Typical lookback window: ~60–120 trading days
For educational and research purposes only. Not financial advice.
Ivan Liu Economics & Data Science @ USC