Hanging Man Pattern Tested — Full Breakdown & Transcript

用Python量化100个K线形态(1):反转形态上吊线【量化投资邢不行啊】

0h 01m video Published Oct 10, 2022 Transcribed Sep 12, 2026 量化投资邢不行啊 量化投资邢不行啊
1.1K views Recent velocity 0.0 views/hour View full performance history →
Intermediate 2 min read For: Retail traders and quantitative investing enthusiasts interested in testing technical analysis patterns with Python.
AI Trust Score 72/100
⚠️ Average / Some Fluff

"Title promises a scientific test of K-line patterns, and the video delivers exactly that — a clear, data-driven verdict on the hanging man."

AI Summary

This video tests whether the classic 'hanging man' candlestick pattern actually predicts price drops in China's A-share market. Using Python and historical data from 2007 to today, the creator quantifies the pattern and finds it ineffective, challenging a common technical analysis belief.

[00:00]
Series Introduction

The video introduces a series that will test classic K-line patterns using Python and historical A-share data.

[00:36]
Hanging Man Definition

The hanging man appears in an uptrend, has a long lower shadow (at least 2x body), almost no upper shadow, and closes higher than the next day's close.

[01:03]
Quantifying the Pattern

The creator translates the pattern's vague description into precise, quantifiable rules and implements them in Python.

[01:15]
Backtest Results

The code found over 80,000 occurrences of the hanging man pattern in A-shares from 2007 to today.

[01:27]
Pattern Ineffectiveness

The pattern did not lead to significant price drops; the probability of decline and average returns over the next 1-20 days were poor, indicating the pattern is ineffective in A-shares.

Mentioned in this Video

Tutorial Checklist

1 00:36 Define the hanging man pattern with precise rules: long lower shadow (at least 2x body), almost no upper shadow, and close higher than next day's close.
2 01:03 Translate the pattern description into quantifiable conditions in Python code.
3 01:15 Run the code on historical A-share data from 2007 to today to find all occurrences.
4 01:27 Calculate the probability of price decline and average returns over the next 1 to 20 days after each occurrence.
5 01:27 Analyze the results to determine if the pattern is effective; in this case, it was not.

💡 Key Takeaways

📊

80,000+ occurrences of the hanging man

Provides a large sample size, making the statistical conclusion more reliable.

01:15
💡

The pattern fails to predict drops

Challenges a widely believed technical analysis assumption with data.

01:27
🔧

Quantifying a vague pattern with Python

Shows how to turn a subjective pattern into testable, precise rules.

01:03

[00:00] 很多人炒股喜欢研究K线 他们认为不同K线形态暗含着未来股价的涨跌信息 比如认为起明星形态出现后股价会上涨 高位出现三只乌鸦形态预示着价格即将下跌等等等等

[00:12] 那么这些K线形态在A股到底真的有效吗? 我会用一系列的视频 逐一研究各个经典的K线形态 编写相应的Python代码 并用全量的历史数据来验证它们的效果 感兴趣的朋友可以点击关注以防迷路

[00:24] 大家好,我是专注于量化投资的行不行 关注我,科学投资不迷路 今天要介绍的K线形态是上调线 属于反转形态 这里的上调可不是你想的那个物理超度方法哦 我们结合这张K线图来介绍一下这个形态

[00:36] 大家来看这一天的K线 它有几个显著的特征 第一,它出现在上涨趋势中 第二,它的下影线非常的长 是本身柱体长度的两倍以上 而上影线却几乎为零 第三,它的收盘价必须高于第二天的收盘价

[00:50] 也就是说第二天下跌 那么这根K线就是很典型的上调线形态了 一般大家认为这个形态出现呢 就预示着上涨趋势的结束 我们应该卖出相当的股票 是一个卖出信号 好那么我们为了验证上调线的形态是否有效呢

[01:03] 我们需要尝试着把它模糊的描述 转化为精确的可量化的语言 然后使用Python代码把这些条件实现 运行一下代码 我们就可以找出A股历史上 07年至今所有的上调线形态

[01:15] 总共有8万多次 并且我们还可以统计它未来几天股价的涨跌 但是与预想不同的是 这个形态出现之后股价并没有出现明显的下跌 感兴趣的可以暂停看一下这个结果 我就不多加赘述了

[01:27] 我这里还列出了上调线出现后 未来1到20天的股价的下跌概率和平均收益率 表现也都不佳 这也进一步说明了上调线这种形态在A股是无效的 大家下次再遇到的话可以考虑跳过这个信号

[01:39] 另外视频中用到的数据和代码 都是可以分享给大家的 希望大家多多关注和点赞 后续我们还会分享更多的K线形态的验证结果

More from 量化投资邢不行啊

View all

⚡ Saved you 0h 01m reading this? Transcribe any YouTube video for free — no signup needed.