The pinescript-harmonic-detector is a TradingView Pine Script™ indicator specifically designed to automatically identify and provide trading signals for harmonic chart patterns in cryptocurrency markets. This tool helps traders identify potential reversal zones based on geometric price patterns and Fibonacci relationships that often occur in trading charts.
What Problem Does It Solve?
- Eliminates the need for manual harmonic pattern identification
- Provides objective entry, stop-loss, and target levels
- Helps traders find high-probability reversal zones in crypto markets
- Reduces emotional trading through systematic pattern recognition
- Markets: Optimized for Cryptocurrency markets (BTC, ETH, etc.)
- Timeframes: Works on all timeframes (1m to Monthly)
- TradingView Version: Compatible with TradingView Pine Script™ v5+
This indicator can identify the following harmonic patterns:
- Bat Pattern - Features a 0.886 retracement at point D
- Butterfly Pattern - Extended pattern with a 1.27 or 1.618 extension
- Crab Pattern - Known for its extreme projection with 3.14 and 3.618 ratios
- Shark Pattern - Features a first leg retracement of 0.886
- Gartley Pattern - Classic pattern with 0.618 retracement of XA
- Cypher Pattern - Contains specific BC projection
Each pattern is validated against strict Fibonacci ratio criteria for accuracy.
pinescript-harmonic-detector/
├── src/
│ └── harmonic_patterns.pine # Main indicator file (for TradingView publishing)
└── docs/
└── ... # Documentation (coming soon)
TradingView requires indicators to be published as single-file scripts:
- Open the TradingView platform
- Click the "Pine Editor" button in the bottom panel
- Copy the contents of
src/harmonic_patterns.pine
into the editor - Click "Save" to save the script to your personal scripts
- Click "Add to Chart" to apply the indicator to your chart
The indicator includes several customizable settings:
- Pattern Selection: Choose which patterns to detect
- Display Options: Configure visual elements and information display
- Alert Settings: Set up custom alerts for pattern detection
- Sensitivity Controls: Adjust tolerance levels for more or fewer signals
- Not a Standalone System: This indicator works best as part of a comprehensive trading strategy
- False Signals: No indicator is 100% accurate; always confirm with other technical analysis tools
- Market Conditions: Performance may vary in different market conditions (trending vs ranging)
- Repainting: The indicator may adjust patterns as new price data becomes available
- CPU Usage: Detection of multiple patterns across many bars may impact chart performance
Contributions are welcome! If you'd like to improve the indicator:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-improvement
) - Commit your changes (
git commit -m 'Add amazing improvement'
) - Push to the branch (
git push origin feature/amazing-improvement
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.