Skip to content

Automatically captures the candlestick technical chart pattern.

Notifications You must be signed in to change notification settings

choisangh/pattern-scanner-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pattern-scanner-library

A Python toolkit for detecting candlestick chart patterns in financial time series.

Features

  • Built-in recognizers for common formations like head and shoulders, triangles, wedges and more
  • PatternRecognizer utility that attaches pattern detectors to your OHLC data
  • Simple helper functions for geometric calculations

Installation

Install the library with pip from the repository root:

pip install .

Usage

Example showing how to create a recognizer from pandas Series of OHLCV data:

from pattern_scanner import PatternRecognizer

# timestamp, open_price, high_price, low_price, close_price, volume
recognizer = PatternRecognizer(
    window_size=2,
    timestamp=my_timestamp,
    open_price=my_open,
    high_price=my_high,
    low_price=my_low,
    close_price=my_close,
    volume=my_volume,
)

# available pattern classes
recognizer.get_pattern_list()
# detect specific pattern
patterns = recognizer.HeadAndShoulders.check_pattern()
# make plot
recognizer.HeadAndShoulders.make_plot()

image

Running Tests

Execute the unit tests with:

python3 -m pytest

About

Automatically captures the candlestick technical chart pattern.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages