Skip to main content

PatternPy: The Premier Python Package for Trading Pattern Recognition 🔥

Installation

You can install PatternPy by cloning this repo and placing it in your working directory, then importing it like usual:

pip isntall  m-patternpy

Usage

Once installed and imported, you use PatternPy as follows:

from patternpy.tradingpatterns import head_and_shoulders

# Have price data (OCHLV dataframe)
df = pd.Dataframe(stock_data)

# Apply pattern indicator screener
df = head_and_shoulders(df)

# New column `head_shoulder_pattern` is created with entries containing either: NaN, 'Head and Shoulder' or 'Inverse Head and Shoulder'
print(df)

See our usage guide for more detailed instructions and examples.

📈 Trading Patterns: The Gearhead's Guide to Chart Alchemy! 🔧

  • Head & Shoulders and its Mirror-Twin, Inverse Head & Shoulders: Think of this as the stock market's homage to a medieval warrior's stance. The head - the pinnacle of price prowess. The shoulders - slightly lower, but they pack a punch. When it goes inverse, that’s the stock market moonwalking! Keep an eye, because something's about to give. ⚔️

  • Multiple Tops & Bottoms - The Horizontal Tango: When stock prices are doing the cha-cha on the charts, swinging back and forth without breaking out – that’s the Horizontal Tango for you! Put on your dancing shoes because reading this pattern needs finesse and perfect timing. 💃

  • Horizontal Support & Resistance - The Price Bouncers: These levels are like the elite bouncers at an exclusive club. Prices need VIP access to get past them! They’ve been rejected entry before, so will they turn around or sweet-talk their way through this time? 🕶️

  • Ascending & Descending Triangles - Tension Rising: These triangles are like a rubber band stretching – the suspense is nerve-wracking. Is it going to snap upwards or fizzle out downwards? This pattern is the market's own thriller genre. 🍿

  • Wedges: Converging Destiny: Think of wedges as two trendlines playing a high-stakes game of chicken – speeding towards each other to see who veers off first. When they collide, prices could catapult in any direction. Buckle up! 🚀

  • Channel Up & Down - The Stock Superhighway: If stocks were cars, channels would be their autobahns. Unfettered, high-octane movement within defined lanes. Just watch out for those exits - detours might lead to whole new landscapes! 🏎️

  • Double Top & Bottom - The Market's Deja Vu: When prices hit a level, recoil, and then - BOOM - they're back again, it’s like the market is trying to perfect a stunt it couldn't nail the first time. A daring double-attempt before the grand finale! 🎯

  • Trend Line Support & Resistance - The Market’s Elders: These lines are like the wise old sages of stock lore. They've seen things, they know things. Their wisdom? A roadmap of where prices found refuge or faced their nemesis. Respect the elders! 🧙

  • Higher-High & Lower-Low- The Chart Adventurer's Quest: Grab your explorer hat because this pattern is an expedition to uncharted territories. New highs or new lows - they’re the breadcrumbs that lead to the heart of market trends. 🗺️

Contribute

Orignal Author https://github.com/keithorange/PatternPy

Release files for m-patternpy 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for m-patternpy 2.0.1
File Size Uploaded
m_patternpy-2.0.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for m-patternpy 2.0.1
File Interpreter ABI Platform
m_patternpy-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / m_patternpy-2.0.1.tar.gz

Download URL m_patternpy-2.0.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
55936718a57700dfee6cd015fecbc5cc57a4e6b651addaa698359ab002272d13
BLAKE2b-256 checksum
How to use checksums
fa835701060abf88b89a999219d6182728792b9c601855e495a4ff4c29c986fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

Release files / m_patternpy-2.0.1-py3-none-any.whl

Download URL m_patternpy-2.0.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a7bea11a538ebb42984cd2eb81ad14eacf06e334483c56bc07d6c99e9fa8d08
BLAKE2b-256 checksum
How to use checksums
9894919033f2a08f2eb9c42cdb53621276990cfe2acb21227b589a8602c7af25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page