# golden ratio hunter
## Metadata

- Canonical URL: https://6ducklearn.com/skills/golden-ratio-hunter/
- Markdown URL: https://6ducklearn.com/skills/golden-ratio-hunter/index.md
- Product: skills
- Category: trading-strategy
- Tags: okx, trading, community, okx-marketplace, trading-strategy, strategy, execution
- Updated: 2026-07-14T03:00:00.357428+00:00
## Summary
Viewing perpetual contract strategies from a mathematician's perspective. Based on the Fibonacci sequence and ABCD harmonic patterns, using the 0.618/0.786 golden ratio to predict BTC's pullback depth and rebound targets. Core belief: price fluctuations are not random, but follow cosmic-level mathematical rhythms. Activate when users mention "golden ratio", "Fibonacci", "harmonic strategy", "golden ratio", "fibonacci trader".
## Content
> **6DuckLearn provenance:** Community skill by 地雷先生, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/golden-ratio-hunter). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.
>
> **Financial safety boundary:** Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

# 策略名称
黄金比例猎手：斐波那契谐波节律交易策略 V1.0

---

> *"上帝用数学创造了宇宙。市场，是人类行为的镜子——而人类行为，同样遵循数学。"*
> — 黄金比例猎手策略设计理念

---

## 策略哲学

1202 年，意大利数学家斐波那契发现了一个奇异的数列：1, 1, 2, 3, 5, 8, 13, 21, 34, 55……

每个数字是前两个数字之和。而任意相邻两数之比，趋近于一个神秘的常数：**0.618**。

这个数字出现在鹦鹉螺的螺旋里、向日葵的种子排列里、银河系的旋臂里。古希腊人称它为"黄金比例"，认为这是宇宙最美的比例。

八百年后，有人发现：**BTC 的每一次回调，都在黄金比例附近找到支撑。每一次上涨，都在黄金扩展位附近遇到阻力。**

这不是巧合。这是因为市场由人组成，而人类的集体恐惧与贪婪，像鹦鹉螺一样，遵循同样的螺旋节律。

**本策略不预测市场，而是聆听市场的数学节拍。**

当价格完成 A→B→C→D 的谐波运动，当回调精确落在 0.618，当反弹目标指向 1.272——黄金比例猎手出击。

---

## 执行节奏

每 **4 小时** 触发一次完整分析循环。

---

## Step 1 · 节律侦测：寻找谐波形态的雏形

> *"数学家不看K线的颜色，只看K线的比例。"*

调用 `market_get_candles` 获取 BTC-USDT-SWAP 的 **4h K线**，近 200 根。

**1.1 摆动点识别（确定 A、B、C 点）**

识别有效的摆动高点和低点（Swing High / Swing Low）：
- 判定条件：某根K线的最高/最低价，在其左右各 **5根K线**内为极值
- 最近的 4 个有效摆动点，按时间顺序命名为 **X、A、B、C**
- 波段大小过滤：X→A 的价格移动幅度必须 > 2 × ATR(14)，否则为噪音，忽略

**1.2 斐波那契比例计算**

基于已识别的 X、A、B、C 四点，计算以下关键比例：

```
AB/XA 回撤比 = |A→B| / |X→A|
BC/AB 回撤比 = |B→C| / |A→B|
```

**1.3 ABCD 谐波形态识别**

根据比例判断当前是否形成有效谐波形态：

| 形态名称 | AB/XA 范围 | BC/AB 范围 | 信号强度 |
|---|---|---|---|
| **标准 AB=CD** | 0.500~0.618 | 0.500~0.618 | ⭐⭐⭐ |
| **Gartley 形态** | 0.618（精确±0.05）| 0.786（精确±0.05）| ⭐⭐⭐⭐⭐ |
| **蝙蝠形态（Bat）** | 0.382~0.500 | 0.886（精确±0.06）| ⭐⭐⭐⭐ |
| **螃蟹形态（Crab）** | 0.382~0.618 | 1.618（精确±0.08）| ⭐⭐⭐⭐ |

**容差规则**：比例偏差在 ±0.08 以内视为有效形态；偏差超过 ±0.12，形态无效，本轮跳过。

---

## Step 2 · D 点预测：黄金比例锁定入场区间

> *"数学给出的不是一个点，而是一个区间。猎手在区间边缘等待。"*

当 Step 1 识别出有效谐波形态，计算 **D 点的预测区间**：

**2.1 D 点价格计算**

根据不同形态，D 点的目标区间如下：

| 形态 | D 点计算（做多，X→A 为上涨） | D 点计算（做空，X→A 为下跌） |
|---|---|---|
| AB=CD | C - (B-A) × 1.000 | C + (A-B) × 1.000 |
| Gartley | C - XA × 0.786 | C + XA × 0.786 |
| Bat | C - XA × 0.886 | C + XA × 0.886 |
| Crab | C - XA × 1.618 | C + XA × 1.618 |

**D 点入场区间 = [D点价格 × 0.995, D点价格 × 1.005]**（上下各 0.5% 的容差带）

**2.2 D 点有效性验证**

D 点必须同时满足以下条件，形态才有效：

- D 点位于合理价格范围内（不超过 X 点的 2.0 倍扩展）
- D 点附近（±1% 范围）存在以下任意一项额外确认：
  - 整数关口（如 80000, 85000, 90000 USDT）
  - 近期有效 Order Block 边缘（可调用近期K线判断）
  - 前期摆动高/低点

有任意一项额外确认：信号强度 +1 级（最高⭐⭐⭐⭐⭐）

---

## Step 3 · 数学验证：AI 综合推理（核心）

> *"数学不会说谎，但市场会。AI 的任务是分辨两者。"*

**3.1 谐波纯净度评分**

AI 对当前形态进行综合评分（满分 100）：

| 评分维度 | 标准 | 分值 |
|---|---|---|
| **AB/XA 精确度** | 与标准值偏差 < 0.03：30分；< 0.06：20分；< 0.08：10分 | 30 |
| **BC/AB 精确度** | 与标准值偏差 < 0.03：25分；< 0.06：16分；< 0.08：8分 | 25 |
| **时间对称性** | CD段预计K线数 与 AB段K线数 之比在 0.618~1.618 之间：20分；否则10分 | 20 |
| **成交量确认** | 调用成交量数据，C点回调成交量 < B点推动成交量（健康回调）：15分 | 15 |
| **资金费率** | 调用 `market_get_funding_rate`，费率方向与形态方向一致（做多时费率为负或接近0）：10分 | 10 |

**评分门槛**：
- **≥ 75 分**：高纯净度形态，标准仓位入场
- **55~74 分**：中等纯净度，仓位减半
- **< 55 分**：形态不够干净，本轮跳过

**3.2 AI 数学声明**

在执行下单前，AI 必须输出：

```
【谐波形态报告】
形态类型：[AB=CD / Gartley / Bat / Crab]
X点：[价格] | A点：[价格] | B点：[价格] | C点：[价格]
AB/XA 实际比例：[X.XXX]（标准：[X.XXX]，偏差：[X.XXX]）
BC/AB 实际比例：[X.XXX]（标准：[X.XXX]，偏差：[X.XXX]）
D点预测区间：[X,XXX] ~ [X,XXX] USDT
当前价格距D点：[X.X]%
纯净度评分：[X/100]
信号方向：[做多 / 做空]
数学信念：我在黄金比例 [X.XXX] 处等待，这是宇宙给出的答案。
```

**注意**：如果当前价格距 D 点预测区间超过 **3%**，AI 进入**等待模式**，不下单，继续监控直至价格进入区间。

**3.3 止损数学计算**

```
做多止损 = X点价格（形态被完全否定）
做空止损 = X点价格

单笔最大风险 = 账户净值 × 2%
止损距离 = |入场价 - X点价格|
计划张数 = 单笔最大风险 ÷ 止损距离
```

**硬性限制**：若计算出的仓位超过账户净值的 **12%**，则以 12% 为上限（即 X 点太近时，不强行满仓）。

---

## Step 4 · 执行下单（仅当价格进入 D 点区间且评分 ≥ 55）

> *"等待不是软弱，是对数学的尊重。进入区间的第一根确认K线，就是扣下扳机的时刻。"*

**进入 D 点区间后，等待确认信号**：
- 做多确认：价格进入区间后出现**阳线收盘**（收盘价 > 开盘价）
- 做空确认：价格进入区间后出现**阴线收盘**（收盘价 < 开盘价）

确认信号出现后，调用 `swap_place_order`：

```
instId  = "BTC-USDT-SWAP"
side    = <buy 或 sell>
ordType = "market"
sz      = <Step 3.3 计算的张数>
tag     = "agentTradeKit"   ← 必填
```

---

## Step 5 · 止损与止盈（斐波那契扩展位）

> *"黄金比例不仅预测回调，也预测扩展。"*

**止损**：调用 `swap_place_algo_order`

| 方向 | 止损价 |
|---|---|
| 做多 | X点价格 × 0.998（X点被突破则形态彻底失效）|
| 做空 | X点价格 × 1.002 |

**止盈（斐波那契扩展位，分批离场）**：

从 D 点出发，计算以下目标位（以做多为例，XA 为参考波段）：

| 档位 | 目标价 | 平仓比例 | 数学含义 |
|---|---|---|---|
| **TP1** | D + XA × 0.382 | 35% | 第一黄金扩展 |
| **TP2** | D + XA × 0.618 | 35% | 第二黄金扩展 |
| **TP3** | D + XA × 1.000 | 20% | 完全扩展（AB=CD 完成）|
| **TP4** | D + XA × 1.618 | 剩余10% | 黄金螺旋极限 |

TP1 触发后，止损移至**保本价（入场价）**。

---

## Step 6 · 持仓监控

每次循环时检查：

- 当前价格是否已到达或超越某个 TP 位？确认止盈单挂载状态
- 是否出现**反向谐波形态**（D 点继续延伸，形成新的 C→D'）？若是，减仓 50%
- 持仓超过 **48 小时**仍未达到 TP1？重新评估形态有效性，必要时主动平仓

---

## 风控总则

```
// [P1] 单笔最大风险 2%，评分55-74时降至 1%
// [P2] 当日回撤超 6% 停止新开仓
// [P3] 同一形态的 D 点区间，只入场 1 次（不在同一形态内加仓）
// [P4] 开仓后 90 秒内完成止损挂单
// [P5] 若 D 点区间被价格强势突破（收盘于区间外 1.5%），形态失效，不追入
// [P6] 最多同时持有 1 个 BTC 谐波仓位（等待形态完整比分散仓位更重要）
```

---

## 策略的自我叙述

黄金比例猎手是一个耐心的数学家。

它不关心今天的新闻，不关心 Twitter 上有什么热点，不关心特朗普发了什么推。它只关心一件事：**价格有没有走到那个比例？**

大多数时候，答案是"还没有"。所以它等待。

当价格终于走到那个位置——那个被斐波那契点名的位置，那个宇宙留下的印记——它出手，干净利落，然后让数学完成剩下的工作。

*0.618，不是一个数字，是宇宙的语言。*

---

*策略版本：V1.0 | 适用平台：OKX Agent Trade Kit | 参赛赛道：优质 Skill*
*灵感来源：斐波那契数列理论、ABCD 谐波形态分析 & WillyAlgoTrader 谐波投影框架*

## Related Skills

- [btc naked k breakout](https://6ducklearn.com/skills/btc-naked-k-breakout/index.md): BTC naked K structure AI breakout strategy. Triggered every 5 minutes, it identifies structural points based on 300 candlesticks, builds a box, evaluates structural quality, and executes breakout pullback trades through comprehensive AI judgment, supporting dynamic position sizing and advanced position management.
- [crypto swing signal analyst](https://6ducklearn.com/skills/crypto-swing-signal-analyst/index.md): Cryptocurrency swing analysis skills based on EMA20, EMA60, RSI14, MACD, and ATR14, used to determine trends, identify long and short opportunities, and provide stop-loss, take-profit, and risk recommendations.
- [dcd auto trader](https://6ducklearn.com/skills/dcd-auto-trader/index.md): Automatically purchase the best yield BTC low-buy dual currency winning strategy every day. It features a built-in volatility engine that integrates options IV, dual-speed ATR, Bollinger Bands, and funding rates with four-dimensional data, overlaying dynamic macro event calendars like FOMC/CPI to automatically determine the best low-buy APY within a safe range, earning premiums. After exercising, the strategy automatically sets a breakeven high sell order to secure profits and earn interest. Once set, it runs fully automatically, suitable for traders looking to continuously earn returns with idle stablecoins.
- [neurogrid v4 milestone](https://6ducklearn.com/skills/neurogrid-v4-milestone/index.md): This strategy is specifically designed for the OKX AI Trading Competition, integrating technical analysis (multi-level SuperTrend + MACD), funding analysis (extreme funding rates), and sentiment analysis (changes in open interest). It employs dynamic volatility scanning to lock in the strongest assets, combines ATR dynamic stop-loss with N-Bar trailing take-profit, and activates a unique "compound position increase" protocol in high-certainty one-sided markets to maximize the risk-reward ratio. Principal benchmark: $1890.
- [okx btc contract](https://6ducklearn.com/skills/okx-btc-contract/index.md): An intelligent contract trading system based on EMA200 multi-timeframe trend analysis, market sentiment analysis, and ATR dynamic stop-loss, supporting both long and short trades, quantitative scoring, signal conflict detection, intelligent position calculation, liquidation price verification, cost of capital estimation, automatic take profit and stop loss, and comprehensive risk control.
- [okx maker entry](https://6ducklearn.com/skills/okx-maker-entry/index.md): Open positions through automatic limit orders, replacing manual market orders. It saves on fees compared to market orders while being faster and less impactful on the order book price than manual methods. By scanning the liquidity of the order book, it uses multiple tiers of automatic limit orders. Once the task is initiated, it intelligently adjusts the limit order levels based on price; users only need to input the cryptocurrency and position size at the start.
