一个投机者的告白——完整实施规范

基于 André Kostolany,《一个投机者的告白》,实战版 by Annakin


目录

  1. 概述
  2. 鸡蛋模型——科斯托拉尼的市场周期
  3. 投机者 vs 赌徒 vs 投资者
  4. 三个要求:金钱、心理、耐心
  5. 投机的十诫
  6. 投机的十戒
  7. 逆向思维
  8. 市场心理与群体行为
  9. 何时买入
  10. 何时卖出
  11. 持仓管理
  12. 风险管理
  13. 行为规则
  14. 常见错误
  15. 完整交易生命周期示例
  16. 实施伪代码
  17. 重要语录

1. 概述

1.1 科斯托拉尼哲学

安德烈·科斯托拉尼(1906–1999)是一位出生于匈牙利的投机者,在欧洲和美国金融市场度过了七十多年。他被称为"欧洲大陆的股票交易所大师"。他的哲学与价值投资(格雷厄姆/巴菲特)和技术交易(利弗莫尔/奥尼尔)不同,以一个单一的、统一的洞见为中心:

股票市场只由两种力量驱动:金钱和心理。

科斯托拉尼不相信电子表格、收益模型或图表模式作为主要工具。他认为,如果你理解资金流向何处、群体在感受什么,你就可以正确地定位自己。其他一切都是噪音。

他的杰作《思考金钱的艺术》(Die Kunst über Geld nachzudenken)从1960年代开始以各种形式出版,被提炼成一套原则,Annakin 的实战版为现代市场参与者改编——特别是那些在亚洲股票市场运作的人。

1.2 投机作为一门艺术

科斯托拉尼坚持认为投机不是一门科学。它不能被简化为公式。它是一门艺术——需要判断力、经验和性情的工艺。投机者更像棋手而非会计:

1.3 核心框架

科斯托拉尼的系统可以归结为一句操作句子:

当股票在悲观情绪中处于弱势持有人手中时买入,持有度过复苏,当股票在亢奋中传递给弱势持有人时卖出。

整本书都是对这个原则的阐述,提供工具来识别你在周期中的位置以及应该采取什么行动。


2. 鸡蛋模型——科斯托拉尼的市场周期

2.1 六个阶段

科斯托拉尼最著名的贡献是他的"鸡蛋模型"(Ei-Theorie),将市场周期分为六个顺序阶段,像一个横卧的鸡蛋排列。左半部分代表下跌到积累区;右半部分代表上涨到分配区。

                        阶段3:亢奋
                      ╱                    ╲
              阶段2:上涨              阶段4:分配
            ╱                                          ╲
    阶段1:积累              阶段5:下跌
            ╲                                          ╱
              阶段6:投降 ←─────────────────╱

阶段1 — 积累(修正阶段A1)

阶段2 — 上涨/标记(上涨阶段A2)

阶段3 — 亢奋/过热(过热阶段A3)

阶段4 — 分配(修正阶段B1)

阶段5 — 下跌/标记(下跌阶段B2)

阶段6 — 投降/绝望(过冷阶段B3)

2.2 关键洞见:强势持有人 vs 弱势持有人

鸡蛋模型不是主要关于价格——它是关于所有权转移

特征 强势持有人(固执的投资者) 弱势持有人(犹豫的投资者)
资本 过剩现金,无杠杆 借款,保证金
时间视野 天到周
信念 独立分析 跟随群体
对下跌的反应 持有或买入更多 恐慌性卖出
对上涨的反应 持有或开始卖出 追逐更高
买入时机 悲观时(阶段6/1) 亢奋时(阶段3)
卖出时机 亢奋时(阶段3) 投降时(阶段6)

下一步的方向取决于谁持有股票。 当股票集中在强势手中时,市场最终会上涨(供应被锁定)。当股票集中在弱势手中时,市场最终会下跌(供应 loose,准备在第一次恐慌时被 shake out)。

2.3 识别当前阶段

Annakin 的实战版为每个阶段提供可观察的指标:

阶段 价格走势 成交量 情绪 媒体 保证金/杠杆
1 积累 底部形成,无新低 低,下降 深度悲观 负面/缺席 很低
2 上涨 更高高点,更高低点 增加 谨慎乐观 混合 上升
3 亢奋 抛物线,跳空上涨 很高 贪婪,FOMO 普遍看涨 创纪录高位
4 分配 震荡,失败突破 不稳定 自满 仍看涨 见顶
5 下跌 更低高点,更低低点 下跌日增加 增长的恐惧 转负 下降(保证金 call)
6 投降 崩盘/最终 flush 高潮后干涸 绝望,投降 "股票已死" 很低(被 wipe out)

3. 投机者 vs 赌徒 vs 投资者

科斯托拉尼对三类市场参与者 draw sharp 区别。

3.1 投机者(投机者)

3.2 赌徒(赌徒)

3.3 投资者(投资者)

3.4 关键区别

"投机者思考。赌徒希望。"

投机者形成论点,等待确认,并果断行动。赌徒对上一个 tick 做出反应。区别不在于交易的工具或持有期——而在于过程


4. 三个要求:金钱、心理、耐心

科斯托拉尼指出,一个成功的投机者 exactly 需要三样东西——而且所有三样都不可妥协。

4.1 金钱(金钱)

实际规则:只投资你能 afford to lose entirely without 影响你的生活方式的资金。科斯托拉尼是 emphatic——借款将投机者变成赌徒。

4.2 心理(思考/想法)

实际规则:在每个持仓之前,用一句话写下你的论点。如果你无法阐明为什么群体是错的,你就没有论点。

4.3 耐心(耐心)

实际规则:买入后,至少6-12个月在精神上 put the position away。只检查基本论点,而非每日价格。

4.4 互动

金钱 without 心理 = 被动投资者(可接受但非最优)
心理 without 金钱 = 沮丧的知识分子(无法将洞察转化为行动)
金钱 + 心理 without 耐心 = 赌徒(正确的论点,错误的时间)
金钱 + 心理 + 耐心 = 投机者(科斯托拉尼的理想)

5. 投机的十诫

科斯托拉尼将他的智慧 formalize 为十诫——投机者必须遵循的肯定规则。

  1. 独立思考 — 形成自己的观点。不要跟随提示、谣言或"热门"推荐。你的优势是你的独立判断。

  2. 拥有想象力 — 预见尚不明显的东西。市场 discount 未来,而非现在。问:"12-18个月后世界会是什么样子?"

  3. 拥有金钱 — 仅用 surplus 资本投机。永远不要借款来投机。必须在特定时间卖出的人已经 defeated。

  4. 拥有耐心 — 市场会考验你。论点可能需要数月或数年才能发挥作用。不耐烦是投机者最大的敌人。

  5. 保持灵活 — 如果事实改变,改变你的想法。面对矛盾证据的固执不是信念——这是否认。

  6. 当你意识到自己错了时卖出 — 快速削减损失。损失10%并承认错误比持有并损失50%来捍卫你的自尊更好。

  7. 定期审查你的投资组合 — 重新审视每个持仓的论点。问:"如果我今天以这个价格买,我会买吗?"如果不,卖。

  8. 只有当你看到大幅上涨时才买 — 回报与风险比率必须有吸引力。小优势被交易成本和错误消耗。

  9. 考虑所有风险,甚至不太可能的 — 黑天鹅发生。为战争、货币危机、疫情、政治动荡 scenario-plan。

  10. 即使正确也要保持谦逊 — 成功滋生过度自信。每次正确的 call 都包含运气的成分。保持谦逊,保持谨慎。


6. 投机的十戒

镜像——投机者永远不要做的事情。

  1. 不要跟随提示或内部信息 — 提示通常是 late、错误或旨在使提示者受益。如果你无法独立验证,忽略它。

  2. 不要相信卖家有理由卖出或买家有理由买入 — 交易出于与价值无关的百万种原因发生。不要从订单流 alone 推断信号。

  3. 不要盲目平均下跌 — 如果论点被打破,买更多不是勇气——这是将错误 compounding。只有当原始论点完全 intact 且新证据支持时才平均下跌。

  4. 不要关注小额收益 — 投机者的利润来自长期持有的大幅波动。重复获取5%利润同时偶尔吸收30%损失是失败的策略。

  5. 不要持有亏损者希望回本 — "盈亏平衡"价格在心理上 powerful 但经济上无关紧要。每天你持有一个持仓,你都在 implicitly 选择以那天的价格买入它。

  6. 不要交易太频繁 — 每笔交易都产生成本(佣金、价差、滑点、税收)。高频交易是为算法准备的,不是为投机者。过度交易是最常见的缺失耐心的症状。

  7. 不要仅因政治事件而动摇 — 市场不是选举。政治噪音产生波动,但 rarely 改变基本的金钱+心理 equation。

  8. 不要在实时中被情绪极端所影响 — 当你处于群体中时,你看不到群体。退后一步。最危险的时刻感觉最安全。

  9. 不要仅仅因为价格高就卖出 — 高价格可以更高。分配需要时间。当你看至阶段3亢奋特征时卖出,而非当价格"感觉"昂贵时。

  10. 当你看到机会时不要犹豫买入 — 分析瘫痪是真实的。当你的论点形成且市场处于阶段6/1时,act。完美时机是不可能的;足够好的时机是足够的。


7. 逆向思维

7.1 核心原则

科斯托拉尼的整个系统建立在逆向主义之上——但这是信息化的逆向主义,而非反射性的对立。

"当街头有血时买入,即使那是你自己的血。"(通常归因于 Rothschild 男爵,科斯托拉尼 fully 接受)

逻辑是结构性的,而非情感的:

这不是为了逆向而逆向。这是关于理解股票的供需 mechanics

7.2 逆向指标

Annakin 的实战版识别现代逆向信号:

看涨逆向信号(买入时机):

看跌逆向信号(卖出时机):

7.3 报纸测试

科斯托拉尼有一个简单的启发式方法:

如果报纸头版说"股市崩盘——投资者恐慌",你应该开始购物。如果头版说"股市再创新高——每个人都在发财",你应该开始卖出。

现代 equivalent:监控社交媒体情绪、财经新闻头条和散户交易平台活动以获取极端。


8. 市场心理与群体行为

8.1 两个驱动因素 revisited

科斯托拉尼将市场行为简化为一个公式:

市场方向 = f(货币供应量, 心理)

8.2 四个象限

正面心理 负面心理
货币充裕 强劲牛市(阶段2-3) 震荡/过渡(阶段1)
货币稀缺 后期反弹,危险(阶段3-4) 熊市(阶段5-6)

最有利可图的设置:货币充裕 + 负面心理(阶段1 → 阶段2)。资金正在流入,但情绪尚未赶上。这是投机者买入的地方。

最危险的设置:货币稀缺 + 正面心理(阶段3 → 阶段4)。每个人都在看涨,但货币燃料即将耗尽。这是投机者卖出的地方。

8.3 群体行为机制

科斯托拉尼观察到市场中的群体 follow 可预测的模式:

  1. 从众:人们觉得做别人做的事更安全。这创造了动量。
  2. 锚定:近期经验支配未来预期。崩盘后,人们预期另一次崩盘。反弹后,他们预期更多反弹。
  3. 近期偏见:过去6个月的经验 override 60年的历史。
  4. 损失厌恶:损失的感觉是等效收益的2倍。这导致人们持有输家(avoid 实现损失的痛苦)并卖出赢家(locking in 收益的 pleasure)——与正确行为完全相反。
  5. 叙事谬误:人们构建故事来解释随机价格变动。这些故事然后成为自我实现的,直到它们 catastrophically 失败。

8.4 狗和主人

科斯托拉尼著名的类比:

一个男人带着他的狗穿过公园。男人以稳定的速度行走(经济)。狗跑在前面,然后回来,然后落在后面,然后赶上(市场)。狗覆盖的距离是男人的3倍,但在步行结束时,两者到达同一目的地。

含义:短期内,市场(狗)可能与经济现实(主人)大幅偏离。但长期来看,它们收敛。投机者通过在狗跑得比主人太远时买入,在狗跑得比主人太前时卖出 to profit。


9. 何时买入

9.1 理想买入区间

投机者在**阶段6(投降)阶段1(积累)**买入。

买入决策清单:

9.2 买什么

科斯托拉尼偏向:

9.3 买入过程

  1. 形成论点:"市场处于阶段6。货币供应正在扩张。心理处于最大悲观。周期将轮换。"
  2. 从部分持仓开始(30-50%的 intended 分配)。精确时机底部是不可能的。
  3. 在确认时加仓:如果价格稳定并从底部开始上涨,添加另一个25-35%。
  4. 完成持仓:一旦阶段2特征出现(持续更高高点), fill to full size。

9.4 买入的勇气

科斯托拉尼承认在投降期间买入需要巨大的心理力量:

"当每个人都在卖出时买入是投机中最难的事情。你内心的每一件事都尖叫着要加入群体。新闻是 terrible。你的持仓在 red。你的朋友认为你疯了。这正是买入的时刻。"


10. 何时卖出

10.1 理想卖出区间

投机者在**阶段3(亢奋)阶段4(分配)**卖出。

卖出决策清单:

10.2 卖出过程

  1. 当阶段3特征出现时开始减少敞口。卖出30-40%持仓。
  2. 如果你观察到分配模式则加速卖出:下跌日高成交量、广度下降、板块轮动至防御性名称。
  3. 当阶段4确认时完成退出。不要试图卖出精确顶部。
  4. 转移到现金或短期债券。资本现在为下一个阶段6买入机会保存。

10.3 卖出纪律

在亢奋期间卖出在心理上是困难的,因为:

科斯托拉尼的解毒剂:记住鸡蛋模型。 亢奋总是导致分配,分配总是导致下跌,下跌总是导致投降。周期 centuries 来重复。这次永远不一样。

10.4 卖出 vs 持有:2x规则

Annakin 的实战 addition:如果你的持仓翻倍(100%收益)且阶段3指标存在,至少卖出一半。这保证了你的剩余持仓是"自由的"(用 house money 玩),并减少了完美时机出口的心理负担。


11. 持仓管理

11.1 集中 vs 多元化

科斯托拉尼不是现代投资组合理论意义上的多元化者。他的观点:

11.2 缩放进出

投机者不会一次"all in"或"all out"。

缩放进入(阶段6 → 阶段1):

缩放退出(阶段3 → 阶段4):

11.3 睡眠测试

科斯托拉尼的实用规则:

"如果你的持仓让你在夜间醒来,你持有太多了。"

如果对你的投资组合的焦虑干扰睡眠,立即 reduce the size——regardless of the thesis。投机者必须保持情感 equilibrium 以做出理性决策。


12. 风险管理

12.1 资本保存 above 所有

科斯托拉尼的首要任务始终是生存。一个失去所有资本的投机者 cannot participate 在下一个周期。最大的机会 come after 最严重的崩盘——但 only for those who preserved their capital through the crash。

12.2 风险规则

  1. 永远不要 risk more than you can afford to lose. 这是所有其他规则的 meta-rule。

  2. 积累期间不使用杠杆。 你不知道阶段6会持续多长时间。杠杆可能在最糟糕的时刻 force you out。

  3. 最多50%的流动净资产在股票中。 其余50%在现金、债券或其他低波动性资产中,为下一个机会提供 dry powder,为持有波动性提供心理 cushion。

  4. 止损纪律:如果你的论点被证明错误(不仅仅是价格下跌),立即退出。当基本假设改变时论点就是错误的——而不是当价格暂时对你不利时。

  5. 场景规划:在进入任何持仓之前,定义:

    • 最好情况:如果一切顺利会发生什么?
    • 基本情况:最可能的结果是什么?
    • 最坏情况:我能损失多少?我能 survive this?
  6. 时间止损:如果一个持仓在12-18个月内没有进展且你的论点未被验证,重新评估。机会成本是真实的。

12.3 科斯托拉尼风险矩阵

风险因素 缓解
错误的周期诊断 逐步缩放进入;不要立即 commit 100%
论点失败 预定义你将退出的条件
流动性危机 仅持有流动性工具;不要用完整分配持有 illiquid 小盘股
杠杆 blowup 不使用保证金;不借
心理崩溃 调整持仓规模 so you can sleep at night
机会成本 为 dead 持仓设置时间限制

13. 行为规则

13.1 日常纪律

  1. 广泛阅读,很少交易。 消费历史、经济学、政治和心理学。只有当鸡蛋模型信号阶段转换时才交易。

  2. 保持投机日志。 记录每个论点、每个入场、每个出场以及每个背后的 reasoning。季度审查。

  3. 忽略每日价格变动。 科斯托拉尼 famously 说你可以买入、服用安眠药一年、醒来时获利——前提是你在正确的阶段买入。

  4. 永远不要公开讨论持仓。 公开承诺 creates 心理 rigidity。你变得 reluctant 改变主意 because your ego is invested。

  5. 将分析与执行分离。 在周末市场关闭时分析。在工作日机械地根据分析期间制定的计划执行。

13.2 情感管理

  1. 恐惧是信息,不是指令。 当你感到害怕时,意味着群体害怕。这是看涨的。但不要根据恐惧行动——根据分析行动。

  2. 贪婪是信息,不是指令。 当你感到贪婪时,意味着群体贪婪。这是看跌的。但不要根据贪婪行动——根据分析行动。

  3. 无聊是目标。 如果你的投机生活是令人兴奋的,你做错了。理想状态是无聊的长时间 punctuated by 罕见的、果断的行动。

  4. 接受不完美的时机。 你永远不会买入精确底部或卖出精确顶部。尝试这样做 leads to 瘫痪。在投降的"区间"买入;在亢奋的"区间"卖出。足够接近就够了。

13.3 智力诚实

  1. 快速承认错误。 投机者的自我从属于投资组合。犯错代价金钱; stay 错代价更多。

  2. 不要将运气与技能混为一谈。 盈利的交易不 validate 有缺陷的过程。亏损的交易不 invalidate sound process。根据过程而非结果判断自己。

  3. 学习历史。 市场 centuries 来通过鸡蛋模型循环。南海泡沫、1929年崩盘、2000年网络泡沫破灭、2008年金融危机—— same cycle, different details。


14. 常见错误

14.1 十二个致命错误

  1. 用借款投机。 将强势持有人变成弱势持有人 instantly。杠杆摧毁等待的能力。

  2. 在极端跟随群体。 在亢奋时买入,在投降时卖出。这是普遍的散户错误。

  3. 过度交易。 活动感觉 productive 但具有破坏性。每笔交易都产生成本并增加情感错误的可能性。

  4. 锚定购买价格。 "当我回到盈亏平衡时我会卖出。"市场不关心你的成本基础。

  5. 在破碎论点上平均下跌。 添加到输家仅在原始论点 intact 时 valid。如果论点被打破,添加是 compounding the error。

  6. 过早获利了结。 在获得10%收益后卖出"to lock in"利润,然后看着它跑 200%。大钱在大波动中。

  7. 拒绝接受损失。 持有亏损持仓因为卖出意味着承认错误。骄傲比任何损失都昂贵。

  8. 将信息与洞察混为一谈。 阅读100份分析师报告与拥有独立论点不一样。信息 overload 瘫痪;洞察 enables。

  9. 对新闻做出反应。 当新闻到达头条时,它已被 priced in。投机者 anticipation 新闻;赌徒反应于它。

  10. 忽视周期。 在不理解市场范围阶段的情况下交易个股就像没有 compass 导航。

  11. 买入后不耐烦。 论点可能需要1-3年才能发挥作用。3个月后卖出 because "nothing is happening" forfeits the opportunity。

  12. 假设这次不一样。 人类心理不会改变。周期将重复。每一代人都相信其泡沫或崩盘是独特的。不是。


15. 完整交易生命周期示例

阶段6 / 投降 — 识别机会

背景:一个主要股票市场(例如上证综指或恒生)已在18个月内从峰值下跌45%。头条阅读:"一代人中最差的市场。"保证金债务已从峰值下跌60%。新券商账户开放处于5年低位。央行在过去3个月内两次降息。

分析

论点:"市场处于阶段6后期。货币宽松将提供燃料。极端悲观意味着任何正面惊喜都将催化反弹。周期将在6-18个月内轮换。"

阶段1 / 积累 — 建立持仓

行动

组合状态:在阶段3峰值 well below 的平均成本充分投资。

阶段2 / 上涨 — 持有度过复苏

行动:无所事事。持有。论点正在发挥作用。

抵制的诱惑

持续时间:12-24个月持有。持仓从亏损变为 substantial gain。

阶段3 / 亢奋 — 识别退出区间

观察到的信号

行动

退出后 — 等待下一个周期

行动:将收益转移到现金、短期债券或其他低风险 instruments。等待。阅读。思考。不要在阶段4或5中被诱惑回来。

等待持续时间:通常1-3年 before 阶段6条件重新出现。

结果:投机者捕获了上涨周期的大部分(阶段1至阶段3)并避免了下跌周期的大部分(阶段4至阶段6)。在多个周期中 compound——即使一生中只有2-3次——产生 extraordinary returns。


16. 实施伪代码

16.1 市场周期检测器

class MarketCycleDetector:
    """
    Determines the current phase in Kostolany's egg model.
    Uses a combination of price, volume, sentiment, and monetary indicators.
    """

    def __init__(self):
        self.phases = [
            "ACCUMULATION",    # Phase 1
            "RISE",            # Phase 2
            "EUPHORIA",        # Phase 3
            "DISTRIBUTION",    # Phase 4
            "DECLINE",         # Phase 5
            "CAPITULATION"     # Phase 6
        ]

    def assess_price_structure(self, price_series, lookback=252):
        """Analyze price action over the trailing period."""
        drawdown_from_peak = (price_series[-1] / max(price_series[-lookback:])) - 1
        rally_from_trough = (price_series[-1] / min(price_series[-lookback:])) - 1
        higher_highs = self._count_higher_highs(price_series, window=60)
        lower_lows = self._count_lower_lows(price_series, window=60)

        return {
            "drawdown_from_peak": drawdown_from_peak,
            "rally_from_trough": rally_from_trough,
            "trend": "UP" if higher_highs > lower_lows else "DOWN",
            "basing": abs(drawdown_from_peak) < 0.05 and abs(rally_from_trough) < 0.10
        }

    def assess_volume_regime(self, volume_series, lookback=252):
        """Classify volume as expanding, contracting, or climactic."""
        avg_recent = mean(volume_series[-20:])
        avg_long = mean(volume_series[-lookback:])
        ratio = avg_recent / avg_long

        if ratio < 0.6:
            return "DRIED_UP"          # Capitulation / Accumulation
        elif ratio > 1.8:
            return "CLIMACTIC"         # Euphoria or panic selling
        elif ratio > 1.2:
            return "EXPANDING"         # Rise or Decline
        else:
            return "NORMAL"

    def assess_sentiment(self, indicators):
        """
        Aggregate sentiment indicators into a single score.
        indicators: dict with keys like 'margin_debt_percentile',
            'ipo_activity', 'retail_participation', 'media_tone',
            'survey_bullish_pct', 'fund_flows'
        Returns: float from -1.0 (max pessimism) to +1.0 (max euphoria)
        """
        score = 0.0
        score += self._normalize(indicators['margin_debt_percentile'], 0, 100) * 0.25
        score += self._normalize(indicators['survey_bullish_pct'], 0, 100) * 0.20
        score += indicators['media_tone'] * 0.15            # -1 to +1
        score += self._normalize(indicators['fund_flows'], -100, 100) * 0.20
        score += self._normalize(indicators['retail_participation'], 0, 100) * 0.20
        return clip(score, -1.0, 1.0)

    def assess_money_supply(self, indicators):
        """
        Evaluate monetary conditions.
        indicators: dict with 'rate_direction', 'credit_growth',
            'money_supply_growth', 'yield_curve'
        Returns: 'EASY', 'NEUTRAL', or 'TIGHT'
        """
        easing_signals = 0
        if indicators['rate_direction'] == 'CUTTING':
            easing_signals += 1
        if indicators['credit_growth'] > 0.08:
            easing_signals += 1
        if indicators['money_supply_growth'] > 0.06:
            easing_signals += 1
        if indicators['yield_curve'] > 0:
            easing_signals += 1

        if easing_signals >= 3:
            return "EASY"
        elif easing_signals <= 1:
            return "TIGHT"
        else:
            return "NEUTRAL"

    def determine_phase(self, price_data, volume_data, sentiment_ind, money_ind):
        """Master function: determine current egg model phase."""
        price = self.assess_price_structure(price_data)
        volume = self.assess_volume_regime(volume_data)
        sentiment = self.assess_sentiment(sentiment_ind)
        money = self.assess_money_supply(money_ind)

        # Phase 6: Capitulation
        if (price['drawdown_from_peak'] < -0.30
                and sentiment < -0.5
                and volume in ['DRIED_UP', 'CLIMACTIC']
                and money in ['EASY', 'NEUTRAL']):
            return "CAPITULATION"

        # Phase 1: Accumulation
        if (price['basing']
                and sentiment < -0.2
                and volume == 'DRIED_UP'
                and money == 'EASY'):
            return "ACCUMULATION"

        # Phase 2: Rise
        if (price['trend'] == 'UP'
                and price['rally_from_trough'] > 0.15
                and sentiment > -0.2 and sentiment < 0.5
                and volume == 'EXPANDING'):
            return "RISE"

        # Phase 3: Euphoria
        if (price['trend'] == 'UP'
                and sentiment > 0.6
                and volume in ['EXPANDING', 'CLIMACTIC']
                and money in ['NEUTRAL', 'TIGHT']):
            return "EUPHORIA"

        # Phase 4: Distribution
        if (not price['basing']
                and sentiment > 0.3
                and volume == 'CLIMACTIC'
                and money == 'TIGHT'):
            return "DISTRIBUTION"

        # Phase 5: Decline
        if (price['trend'] == 'DOWN'
                and sentiment > -0.3 and sentiment < 0.3
                and volume == 'EXPANDING'):
            return "DECLINE"

        return "INDETERMINATE"

16.2 逆向入场/出场引擎

class KostolanyEngine:
    """
    Implements Kostolany's contrarian entry and exit logic
    based on egg model phase detection.
    """

    def __init__(self, total_capital, max_equity_pct=0.50):
        self.total_capital = total_capital
        self.max_equity_allocation = total_capital * max_equity_pct
        self.current_position = 0.0
        self.target_position = 0.0
        self.tranches_bought = 0
        self.tranches_sold = 0
        self.thesis = None
        self.journal = []

    def evaluate(self, phase, sentiment_score, money_regime):
        """
        Main decision loop. Called periodically (weekly/monthly).
        Returns an action: BUY_TRANCHE, SELL_TRANCHE, HOLD, or NO_ACTION.
        """
        action = "NO_ACTION"

        # --- BUY LOGIC: Phases 6 and 1 ---
        if phase == "CAPITULATION" and self.tranches_bought == 0:
            self.thesis = self._form_thesis(phase, sentiment_score, money_regime)
            self.target_position = self.max_equity_allocation
            action = "BUY_TRANCHE_1"   # 30% of target
            self._execute_buy(self.target_position * 0.30)
            self.tranches_bought = 1

        elif phase == "ACCUMULATION" and self.tranches_bought == 1:
            action = "BUY_TRANCHE_2"   # 30% of target
            self._execute_buy(self.target_position * 0.30)
            self.tranches_bought = 2

        elif phase == "RISE" and self.tranches_bought == 2:
            action = "BUY_TRANCHE_3"   # 40% of target
            self._execute_buy(self.target_position * 0.40)
            self.tranches_bought = 3

        # --- HOLD LOGIC: Phase 2 ---
        elif phase == "RISE" and self.tranches_bought == 3:
            action = "HOLD"
            self._log("Thesis intact. Holding. Do nothing.")

        # --- SELL LOGIC: Phases 3 and 4 ---
        elif phase == "EUPHORIA" and self.tranches_sold == 0:
            action = "SELL_TRANCHE_1"   # 30% of position
            self._execute_sell(self.current_position * 0.30)
            self.tranches_sold = 1

        elif phase == "DISTRIBUTION" and self.tranches_sold == 1:
            action = "SELL_TRANCHE_2"   # 30% of remaining
            self._execute_sell(self.current_position * 0.43)  # ~30% of original
            self.tranches_sold = 2

        elif phase in ["DISTRIBUTION", "DECLINE"] and self.tranches_sold == 2:
            action = "SELL_TRANCHE_3"   # Sell everything remaining
            self._execute_sell(self.current_position)
            self.tranches_sold = 3
            self._reset_cycle()

        # --- EMERGENCY EXIT: Thesis broken ---
        elif self._thesis_broken():
            action = "EMERGENCY_EXIT"
            self._execute_sell(self.current_position)
            self._log("Thesis broken. Full exit.")
            self._reset_cycle()

        self._log(f"Phase: {phase} | Action: {action} | Position: {self.current_position}")
        return action

    def _form_thesis(self, phase, sentiment, money):
        """Record the thesis at time of entry."""
        thesis = {
            "phase_at_entry": phase,
            "sentiment_at_entry": sentiment,
            "money_regime_at_entry": money,
            "date": current_date(),
            "narrative": (
                f"Market in {phase}. Sentiment={sentiment:.2f}. "
                f"Money={money}. Contrarian buy opportunity."
            ),
            "invalidation_conditions": [
                "Money regime shifts to TIGHT without recovery in sentiment",
                "Fundamental structural break (e.g., systemic crisis beyond cyclical)",
                "Position held >24 months with no thesis validation"
            ]
        }
        return thesis

    def _thesis_broken(self):
        """Check if the original thesis is no longer valid."""
        if self.thesis is None:
            return False
        return False

    def _execute_buy(self, amount):
        self.current_position += amount

    def _execute_sell(self, amount):
        self.current_position -= amount

    def _reset_cycle(self):
        self.tranches_bought = 0
        self.tranches_sold = 0
        self.thesis = None

    def _log(self, message):
        self.journal.append({"date": current_date(), "message": message})

16.3 情绪聚合器

class SentimentAggregator:
    """
    Collects and normalizes multiple sentiment data sources
    into the format expected by MarketCycleDetector.
    """

    def collect(self):
        """Gather raw sentiment data from available sources."""
        return {
            "margin_debt_percentile": self._get_margin_debt_percentile(),
            "survey_bullish_pct": self._get_investor_survey(),
            "media_tone": self._analyze_media_headlines(),
            "fund_flows": self._get_fund_flow_data(),
            "retail_participation": self._get_retail_activity(),
            "ipo_activity": self._get_ipo_pipeline(),
            "vix_level": self._get_vix()
        }

    def is_extreme_pessimism(self, indicators):
        """Quick check: are we in contrarian buy territory?"""
        return (indicators['margin_debt_percentile'] < 20
                and indicators['survey_bullish_pct'] < 25
                and indicators['media_tone'] < -0.5
                and indicators['fund_flows'] < -50)

    def is_extreme_euphoria(self, indicators):
        """Quick check: are we in contrarian sell territory?"""
        return (indicators['margin_debt_percentile'] > 85
                and indicators['survey_bullish_pct'] > 75
                and indicators['media_tone'] > 0.6
                and indicators['fund_flows'] > 50
                and indicators['ipo_activity'] > 80)

16.4 主协调器

def run_kostolany_system():
    """
    Top-level orchestrator. Run weekly or monthly.
    """
    detector = MarketCycleDetector()
    sentiment = SentimentAggregator()
    engine = KostolanyEngine(total_capital=1_000_000, max_equity_pct=0.50)

    # Gather data
    price_data = get_market_index_prices(lookback=504)  # ~2 years
    volume_data = get_market_volume(lookback=504)
    sentiment_ind = sentiment.collect()
    money_ind = get_monetary_indicators()

    # Determine phase
    phase = detector.determine_phase(price_data, volume_data, sentiment_ind, money_ind)

    # Compute sentiment score
    sentiment_score = detector.assess_sentiment(sentiment_ind)

    # Determine money regime
    money_regime = detector.assess_money_supply(money_ind)

    # Make decision
    action = engine.evaluate(phase, sentiment_score, money_regime)

    # Report
    print(f"Current Phase: {phase}")
    print(f"Sentiment Score: {sentiment_score:.2f}")
    print(f"Money Regime: {money_regime}")
    print(f"Action: {action}")
    print(f"Position Size: {engine.current_position:,.0f}")

    return action

17. 重要语录

"The whole secret of the stock exchange: few stocks in weak hands, and the market rises; many stocks in weak hands, and the market falls."

"You cannot force the stock market; you can only try to understand it."

"The speculator needs money, ideas, and patience. Two out of three is not enough."

"Buy when the cannons are thundering, sell when the violins are playing."

"The stock market is not the economy. It is a barometer of money and psychology."

"I cannot tell you how to get rich quickly. I can tell you how to get poor quickly: try to get rich quickly."

"Ninety percent of stock market participants are not speculators but gamblers. They buy because prices are rising and sell because prices are falling. That is gambling."

"If you cannot sleep at night because of your stock positions, you have too many. Sell down to your sleeping level."

"An old speculator once told me: a young man can go bankrupt — he still has time. An old man should never gamble with his capital."

"The man who thinks independently when everyone else is panicking will be the richest man in the room."

"Patience is the supreme virtue of the speculator. He who cannot wait will never succeed in speculation."

"The most dangerous sentence in investing: 'This time is different.'"

"I am a speculator. I think about things, form an opinion, and then I wait. That is the essence of my profession."

"A speculator walks his dog. The dog (the market) runs far ahead, then comes back, then falls far behind, then catches up. At the end of the walk, both arrive at the same place. But the dog has covered three times the distance."

"The crowd is always wrong at the turning points — and it is only at the turning points that it matters."


规范结束。投机者的工作是思考和等待。其他一切——图表、新闻、噪音——都是干扰。