TradingPatternScanner

repository·main·Indexed 43 days ago

https://github.com/white07s/tradingpatternscanner

A lightweight Python library (v0.0.5) for high-performance identification of complex financial trading patterns, including Head and Shoulders, Triangles, Wedges, and Channels. It features multiple detection methods for Head-Shoulder patterns using Savitzky-Golay, Kalman, and Wavelet filters to handle noise.

Tokens
585
Snippets
1
Records
4
Agent score
6%

What's inside TradingPatternScanner

  1. Overview of TradingPatternScanner patterns

    main

    TradingPatternScanner is designed to identify various complex technical analysis patterns in financial data. Supported patterns include:

    • Head and Shoulder and inverse Head and Shoulder: Indicates potential market reversals.
    • Multiple top and bottom: Indicates a range-bound market.
    • Horizontal support and resistance: Identifies key price levels.
    • Ascending and Descending Triangle pattern: Indicates potential market breakouts.
    • Wedge up and down: Indicates potential market reversals via converging trendlines.
    • Channel up and down: Indicates strong trends within defined upper and lower trendlines.
    • Double top and bottom: Indicates potential reversals after hitting a high or low twice.
    • Trend line support and resistance: Identifies support/resistance based on historical price action.
    • Finding Higher-High and Lower-Low
  2. Compare Head-Shoulder detection methods

    main

    The library provides four distinct methods for detecting Head-Shoulder (HS) and Inverse Head-Shoulder (I-HS) patterns, each using different signal processing techniques to handle noise. Users should test these against their specific datasets to determine which provides the best accuracy for their data type.

    MethodDescriptionReported Accuracy (Synthetic Data)
    head_shoulder_pattern_windowBasic detection using a rolling window to track high/low points.78.50%
    head_shoulder_pattern_filterUses a Savitzky-Golay filter to reduce noise and considers the height of the 'Head' to avoid false positives.78.50%
    head_shoulder_pattern_kfUses a Kalman Filter (recursive filter) to estimate state in real time, suitable for noisy financial data.73.50%
    head_shoulder_pattern_waveletApplies Wavelet Denoising to eliminate high-frequency noise while preserving key features.84.50%
  3. Tune pattern detection sensitivity

    main

    When using pattern detection methods, you can adjust the window size to balance sensitivity and reliability:

    • Smaller window size: Increases sensitivity (detects more patterns) but increases the risk of false positives.
    • Larger window size: Decreases sensitivity but decreases the risk of false positives.