harmonic

$npx mdskill add HKUDS/Vibe-Trading/harmonic

Identifies harmonic trading patterns using Fibonacci geometry to generate reversal signals in the PRZ.

  • Helps traders detect potential market reversals based on XABCD five-point structures like Gartley and Butterfly.
  • Depends on pyharmonics, pandas, numpy, and requests libraries for analysis and data handling.
  • Decides recommendations by analyzing price structures against predefined Fibonacci ratios for bullish or bearish patterns.
  • Presents results as numeric signals: 1 for long, -1 for short, and 0 for stand aside.

SKILL.md

.github/skills/harmonicView on GitHub ↗
---
name: harmonic
description: Harmonic Patterns signal engine. Identifies XABCD five-point structures such as Gartley/Bat/Butterfly/Crab based on Fibonacci geometry, and generates trading signals in the PRZ (Potential Reversal Zone).
category: strategy
---
# Harmonic Patterns

## Purpose

The Fibonacci geometry school uses precise ratio relationships to identify price patterns:

| Pattern | B-Point Retracement | D-Point Retracement | Direction |
|------|---------|---------|------|
| Gartley | 0.618 XA | 0.786 XA | Reversal |
| Bat | 0.382-0.5 XA | 0.886 XA | Reversal |
| Butterfly | 0.786 XA | 1.27 XA | Reversal |
| Crab | 0.382-0.618 XA | 1.618 XA | Reversal |

## Core Concepts

- **XABCD five-point pattern**: a price structure defined by precise Fibonacci ratios
- **PRZ (Potential Reversal Zone)**: the convergence area around point D, where reversal probability is high
- Bullish pattern (point D at the bottom) → buy signal
- Bearish pattern (point D at the top) → sell signal

## Dependencies

```bash
pip install pyharmonics pandas numpy requests
```

## Parameters

| Parameter | Default | Description |
|------|--------|------|
| is_stock | False | Whether the instrument is a stock (affects analysis parameters) |

## Signal Convention

- `1` = long, `-1` = short, `0` = stand aside

More from HKUDS/Vibe-Trading

SkillDescription
adr-hshareADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.
akshareAKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.
asset-allocationAsset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.
backtest-diagnoseDiagnose failed or underperforming backtests, locate the root cause, and fix the issue
behavioral-financeBehavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.
candlestickCandlestick pattern recognition engine, pure pandas vectorized implementation of 15 classic candlestick patterns (5 single-candle + 5 double-candle + 4 triple-candle + 1 trend confirmation), generating a composite signal from bullish/bearish pattern scores.
ccxtCCXT unified crypto exchange library (100+ exchanges). Free public market data. Fallback when OKX is unavailable.
chanlun基于缠论(缠中说禅)的形态识别引擎,使用czsc库自动检测K线分型、笔、中枢,并生成一买/一卖/二买/二卖/三买/三卖等买卖点信号。支持多周期分析和形态分类(3/5/7/9/11笔形态)。
commodity-analysisCommodity analysis (oil supply-demand balance / gold pricing / copper as an economic predictor / inventory cycles / futures premium-discount structure / seasonality), generating directional commodity signals.
convertible-bondA股可转债分析——转股/纯债/期权三维估值、下修/强赎/回售博弈、双低策略与转债轮动选债框架