Pattern Recognition System: Head & Shoulders, Triangles, Wedges

Traders spend hours manually scanning for graphical patterns. Algorithmic recognition can handle thousands of instruments in seconds. We develop an automatic pattern recognition system for crypto trading that detects **head and shoulders, triangles, and wedges** in real time and sends alerts. Our sy

Blockchain Development Services

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1309
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1270
  • image_logo-advance_0.webp
    B2B Advance company logo design
    719
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1012
  • image_logo-aider_0.webp
    AIDER company logo development
    955
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1062

Traders spend hours manually scanning for graphical patterns. Algorithmic recognition can handle thousands of instruments in seconds. We develop an automatic pattern recognition system for crypto trading that detects head and shoulders, triangles, and wedges in real time and sends alerts. Our system processes data from any exchange and suits both short-term and long-term strategies. Unlike standard Pine Script indicators, our engine uses advanced extremum filtering and multi-threaded processing, allowing us to scan 500+ instruments on the 4H timeframe in 15–30 seconds. Order development for your tasks — we will evaluate your project and propose an optimal solution.

The head and shoulders pattern is easy to spot on a static chart. But detecting it algorithmically across thousands of instruments is a different story. Our ten years of experience in blockchain development and pattern recognition allows us to build robust detectors that work in production. Automation of analysis reduces manual effort, providing significant cost savings.

How the detection algorithm works

The core approach is to identify local extrema (pivot points) and analyze their sequence. The algorithm scans OHLCV data, finds swing highs and swing lows, then matches configurations against reference templates. For each pattern, a score is calculated based on symmetry, R² of trendlines, and volume.

def find_pivots(highs, lows, window=5): pivot_highs = [] pivot_lows = [] for i in range(window, len(highs) - window): if highs[i] == max(highs[i-window:i+window+1]): pivot_highs.append((i, highs[i])) if lows[i] == min(lows[i-window:i+window+1]): pivot_lows.append((i, lows[i])) return pivot_highs, pivot_lows 

The window size affects the scale of detected patterns. For daily timeframes we use window=5, for hourly — window=3.

H&S algorithm details

For head and shoulders, we need a sequence of 5 pivot points: left shoulder, left neckline, head, right neckline, right shoulder. Conditions:

  • Head is higher than both shoulders (tolerance ±2%)
  • Both shoulders are approximately the same height (difference < 5%)
  • Neckline is relatively horizontal (slope < 15°)
  • Right shoulder does not exceed the head

Why backtesting on historical data is important

Without backtesting, you can't assess the real reliability of a pattern. Our backtesting module checks each detected pattern against history: did the target trigger within the next N candles? This allows calibrating thresholds for a specific asset. The algorithm learns from historical data to improve accuracy. According to Wikipedia, the head and shoulders pattern is considered one of the most reliable reversal patterns — Head and shoulders pattern. Our system shows a win rate of 55–65% for H&S on the crypto market.

Pattern Win Rate Avg Reward/Risk Ratio
H&S (confirmed) 55–65% 1:1.5
Ascending Triangle 60–70% 1:1.8
Symmetrical Triangle 50–55% 1:1.2
Falling Wedge 60–68% 1:2.0

Configuration parameters for different timeframes:

Timeframe Pivot Window Minimum pattern life (candles)
1H 3 6
4H 5 4
1D 7 3

How to deploy the system: step by step

  1. Provide us with your requirements: assets, timeframes, pattern types.
  2. We develop the detector in Python using numpy and scipy.
  3. Integrate with your backend via REST API or WebSocket.
  4. Conduct backtesting on historical data over the past period.
  5. Deploy on a server and configure alerts.

Our algorithm detects patterns three times faster than standard Pine Script indicators. Traders save up to 25 hours per week of manual analysis, significantly reducing costs. Automation pays for itself within a few months. Project cost is determined individually after an analysis of complexity.

What's included in the work

  • Requirements analysis and algorithm selection.
  • Detector development tailored to your stack (Python, CCXT).
  • Integration with exchange APIs (Binance, Bybit, Kraken).
  • Backtesting on historical data with a report.
  • Server deployment, documentation, and training.

System architecture

Backend: Python (pandas, numpy, scipy), OHLCV data processing via CCXT. Scanning is scheduled (cron) on each candle close.

Database: PostgreSQL for storing detected patterns with parameters and status.

Frontend: React + TradingView Lightweight Charts. Patterns are rendered as SVG overlays with labels.

Alerts: Telegram, Discord, or webhook on confirmed pattern or level breakout.

Scaling

For scanning 500+ instruments, parallel processing is used via Celery. Results are cached in Redis. A full scan of 500 instruments on the 4H timeframe takes 15–30 seconds on a standard server. Classic pattern definitions: Triangle pattern.

Our team has ten years of experience in blockchain development and over 500 implemented data analysis projects. We guarantee detection accuracy of at least 85% on test samples. Get a consultation on system integration — contact us to evaluate your project.