Skip to main content

CLI and helpers to scan yfinance data for TA-Lib candlestick patterns.

Project description

Forex Candlestick Scanner

Python package + CLI that downloads Yahoo Finance data via yfinance and runs TA-Lib candlestick detectors for your symbol, timeframe, and date filters.

Quick start

# create env
python -m venv .venv
.\.venv\Scripts\activate  # PowerShell; adjust for your shell

# install the package (editable for local dev)
pip install -e .

# run CLI (two entrypoints)
yfinance-ta-patterns --pattern KICKING --symbol EURUSD --timeframe 5m --period 60d
# or
yftp --all-patterns --symbol EURUSD --timeframe 5m --period 60d --date 2025-04-01

pyproject.toml targets Python >=3.12.

CLI usage

yfinance-ta-patterns [--pattern NAME | --all-patterns]
                     [--symbol EURUSD] [--period 60d]
                     [--timeframe 15m] [--date YYYY-MM-DD]
                     [--start-date YYYY-MM-DD] [--end-date YYYY-MM-DD]
  • --pattern: Single candlestick name (with or without CDL prefix).
  • --all-patterns: Scan every TA-Lib candlestick detector.
  • --symbol: Ticker without suffix; =X is appended automatically for Forex (default EURUSD).
  • --period: History window passed to yfinance (e.g., 60d, 1mo).
  • --timeframe: Use M1/M5/M15/M30/H1/H4/D1 or raw yfinance intervals (1m, 5m, 1h, 4h, 1d, etc.). H4/4h is produced by resampling 1h data.
  • --date: Filter signals for a single day.
  • --start-date / --end-date: Inclusive range filter (cannot be combined with --date).

Examples

  • All patterns for a single day:
yftp --all-patterns --symbol EURUSD --timeframe 5m --period 60d --date 2025-04-01
  • All patterns across a range:
yftp --all-patterns --symbol EURUSD --timeframe 5m --period 60d --start-date 2025-04-01 --end-date 2025-04-10
  • One pattern without date filter:
yftp --pattern KICKING --symbol EURUSD --timeframe 5m --period 60d

Data loader

yfinance_ta_patterns/forex_data_loader.py fetches and normalizes OHLC data. It appends =X to symbols when missing and converts timestamps to UTC before shifting to the configured timezone (Europe/Moscow by default).

H4 timeframes are fetched as 1h data and resampled to 4-hour candles.

Pattern analysis

yfinance_ta_patterns/pattern_analyzer.py wraps TA-Lib's CDL* functions, returning non-zero signals and applying optional date filters. When --all-patterns is used, it iterates over the full catalog and prints hits per pattern.

Pattern ranking helper (optional)

yfinance_ta_patterns/pattern_tester.py contains a backtesting-style ranking tool. It depends on utils.pattern_helper.PatternHelper to enumerate patterns; add that helper before running comparisons or exports.

Project layout

  • yfinance_ta_patterns/cli.py: CLI entry point and argument parsing.
  • yfinance_ta_patterns/forex_data_loader.py: Data download and timezone normalization.
  • yfinance_ta_patterns/pattern_analyzer.py: Candlestick signal extraction.
  • yfinance_ta_patterns/pattern_tester.py: Experimental ranking/backtest utilities.
  • main.py: Thin wrapper to launch the CLI.

Packaging and releases

  • Nightly GitHub Actions workflow builds onefile Nuitka binaries for Windows/macOS/Linux (PyPI wheels for TA-Lib on all platforms) and publishes nightly prereleases.
  • PyPI publish workflow runs on tags (needs secret PYPI_API_TOKEN); tags like v0.1.0 will build sdist/wheel and upload.

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

yfinance_ta_patterns-0.1.3.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yfinance_ta_patterns-0.1.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file yfinance_ta_patterns-0.1.3.tar.gz.

File metadata

  • Download URL: yfinance_ta_patterns-0.1.3.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for yfinance_ta_patterns-0.1.3.tar.gz
Algorithm Hash digest
SHA256 005386e4ef8cd84945257da82541368bbd2ac9fe91eb6e30b14af6bddffd8255
MD5 8aec2a09924845b35c65da830bd533cc
BLAKE2b-256 169da63ea727524739d7a46e9fe5c6ac9bb8fab256781a4e9ab46891dcd51a3a

See more details on using hashes here.

File details

Details for the file yfinance_ta_patterns-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for yfinance_ta_patterns-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72f4a9d0d0f26c9e5466c55a47186ae15e94680413dadc0b4f07f1065b2908d6
MD5 30465d7c595b81e9e465cbe2a80de255
BLAKE2b-256 c6852b5f12354ba63bc017be0fe9fe715c4fcf1c6e90a339e0c02a06c81d0927

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page