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/D1 or raw yfinance intervals (1m, 5m, 1h, 1d, etc.).
  • --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).

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 and publishes nightly prereleases.
  • A PyPI publish workflow can be enabled by adding a secret PYPI_API_TOKEN; tags like v0.1.0 will build sdist/wheel and upload.
  • TA-Lib is installed from PyPI on Windows; Linux/macOS CI builds the TA-Lib C library from source for the binaries. For local installs, PyPI wheels (ta-lib >=0.6.8) cover CPython 3.9–3.14.

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.1.tar.gz (11.9 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.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for yfinance_ta_patterns-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ed6517c84337446e8e6acbc108cd35e1beb35d4bc7bb0b3510af3be5d62ecca2
MD5 bce75160488a8e76ec6d65bc126c6e94
BLAKE2b-256 55d09646d3abfc2c3173548e15975a51e3e10a4619224718c3e279d29ba0149a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yfinance_ta_patterns-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83c534053b25aff03aaec9fb4735927dbfc4b2a4a2f2b2f9b80280bbbc4f737f
MD5 6ba4664226d1665dce872996a138199d
BLAKE2b-256 af27d32eafceb4518df75eb4205d73566486a407137c3fec367a683749cda388

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