Dependency-light command-line scanner for Fibonacci harmonic trading patterns from OHLCV CSV files.
It detects XABCD swing structures and validates common harmonic patterns with configurable Fibonacci tolerance:
- Gartley
- Bat
- Butterfly
- Crab
Educational use only; not financial advice. Validate patterns independently and manage risk.
python -m pip install git+https://github.com/mattpartida/harmonic-pattern-cli.gitFor local development:
git clone https://github.com/mattpartida/harmonic-pattern-cli.git
cd harmonic-pattern-cli
python -m pip install -e .Required columns:
timestamp,open,high,low,close,volume
2026-01-01,100,101,99,100.5,1000000volume is optional. All price columns must be numeric.
JSON output:
harmonic-pattern scan examples/sample_gartley.csv --format json --tolerance 0.06Markdown output:
harmonic-pattern scan examples/sample_gartley.csv --format markdown --tolerance 0.06From source without installing:
PYTHONPATH=src python -m harmonic_pattern_cli.cli scan examples/sample_gartley.csv --format jsonEach pattern includes:
pattern: pattern type, e.g.gartleydirection:bullishorbearishpoints: X, A, B, C, D pivotsratios: XAB, ABC, BCD, XAD Fibonacci ratiosentry_zone: D point ± 1%stop_loss: beyond X pointtargets: 38.2% and 61.8% retracements of C-Drisk_reward: target-2 reward divided by stop riskinvalidation: plain-English invalidation level
$ harmonic-pattern scan examples/sample_gartley.csv --format markdown --tolerance 0.06
# Harmonic Pattern Scan
Source: `examples/sample_gartley.csv`
## 1. Gartley (bullish)
...Run tests:
PYTHONPATH=src python -m unittest discover -s tests -qCompile check:
python -m compileall -q src testsPackage smoke:
python -m build
python -m venv /tmp/hpc-smoke
/tmp/hpc-smoke/bin/python -m pip install dist/*.whl
/tmp/hpc-smoke/bin/harmonic-pattern --versionThis is an MVP scanner. Harmonic trading is sensitive to pivot selection, timeframe, liquidity, and market regime. Treat signals as candidates for further chart review, not as trade recommendations.