trend-following-timing

trend-following-timing is a skill for Claude Code, Codex from FeiCoder/Skill-Factory. It costs 53 tokens per session (1,155 once invoked), scanned A, original, MIT.

A trend-following stock-market timing strategy that uses moving averages and indicators such as MACD, DMA, and TRIX to estimate the market direction. It generates buy or sell signals when indicators cross or agree.

In plain words
What is it for?
Use it to calculate technical indicators, combine several signals, compare traditional and adaptive moving averages, and design rules for entering or leaving positions.
Why use it?
It turns price history into explicit rules for following sustained rises or falls, although signals can be less useful when prices move sideways.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to calculate technical indicators, combine several signals, compare traditional and adaptive moving averages, and design rules for entering or leaving positions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/feicoder/skill-factory/trend-following-timing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add FeiCoder/Skill-Factory --skill trend-following-timing
Clone the repo
git clone --depth 1 https://github.com/FeiCoder/Skill-Factory

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for trend-following-timing

README.md
[![agentmods](https://agentmods.dev/badge/skills/feicoder/skill-factory/trend-following-timing.svg)](https://agentmods.dev/skills/feicoder/skill-factory/trend-following-timing)
Your own site
<a href="https://agentmods.dev/skills/feicoder/skill-factory/trend-following-timing"><img src="https://agentmods.dev/badge/skills/feicoder/skill-factory/trend-following-timing.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,155 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.01155
Opus 5 $0.00026 $0.00577
Sonnet 5 $0.00011 $0.00231
Haiku 4.5 $0.00005 $0.00115

Measured 8d ago against content hash d9199abb619e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

trend-following-timing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

produced_skill/timing/trend-following-timing/SKILL.md · 167 lines

What it actually says

趋势追踪择时

基本概念

趋势择时的基本思想来自技术分析,认为趋势存在延续性,找到趋势方向后跟随操作即可。

技术分析三假设

  1. 市场行为涵盖一切信息
  2. 价格沿趋势移动
  3. 历史会重演

技术指标分类

类型 说明 示例
趋势型 判断趋势方向 MA、MACD、DMA
反趋势型 判断超买超卖 RSI、KDJ
能量型 判断买卖力量 OBV、VR
大盘型 判断整体市场 腾落指数

传统趋势指标

1. MA(移动平均)

计算公式

MA(N) = (P1 + P2 + ... + PN) / N

交易法则

  • 均线在价格之下且上升 → 买入
  • 均线在价格之上且下降 → 卖出
  • 金叉:短期均线从下向上穿过长期均线 → 买入
  • 死叉:短期均线从上向下穿过长期均线 → 卖出

参数建议

  • 短期:4日
  • 长期:40日

2. MACD

计算

DIFF = EMA(12) - EMA(26)
DEA = EMA(DIFF, 9)
MACD = 2 × (DIFF - DEA)

交易信号

  • DIFF、DEA均为正,DIFF向上突破DEA → 买入
  • DIFF、DEA均为负,DIFF向下跌破DEA → 卖出

3. DMA

计算

DMA = MA(短期) - MA(长期)
AMA = MA(DMA)

交易信号

  • DMA向上交叉AMA → 买入
  • DMA向下交叉AMA → 卖出

4. TRIX

计算

EMA1 = EMA(收盘价, N)
EMA2 = EMA(EMA1, N)
EMA3 = EMA(EMA2, N)
TRIX = (EMA3 - EMA3前值) / EMA3前值 × 100
MATRIX = MA(TRIX, M)

交易信号

  • TRIX向上交叉MATRIX → 买入
  • TRIX向下交叉MATRIX → 卖出

组合指标策略

多指标叠加

将多个趋势指标信号叠加:

  • 4个指标最优信号相加
  • Flag ∈ {0, 1, 2, 3, 4}

优化结果

最优策略:3-3组合(至少3个买入/卖出信号)

  • 15年测试期内
  • 总交易17次
  • 累计收益:16.39倍
  • 同期指数收益:2.8倍

自适应均线

考夫曼自适应均线(KAMA)

核心理念

  • 震荡市场 → 使用慢速均线
  • 趋势市场 → 使用快速均线

价格轨迹效率

E = |Pn - P1| / Σ|Pi - Pi-1|
  • E → 1:高效率趋势市场
  • E → 0:低效率震荡市场

自适应算法

a = (E × (c - d) + d)²
AMA = AMA前值 + a × (价格 - AMA前值)

参数

  • n:历史窗口
  • c, d:效率边界参数
  • N:自适应系统参数

实证效果(1998年后)

指数 择时收益 持有收益
上证指数 明显超越 基准
深证成指 明显超越 基准

自适应均线特点

  • 优点:适应不同波动形态
  • 缺点:信号频繁,交易成本高
  • 适用:小资金调仓

实践建议

指标选择

  1. 单一指标:推荐MA(4,40)或MACD
  2. 组合指标:4个趋势指标叠加

参数优化

  • 分3个5年区间测试
  • 选择稳定超越基准的参数

交易成本

  • 考虑双边1%交易成本
  • 权衡准确率和交易频率

注意事项

  • 震荡市场易产生错误信号
  • 需要设置止损
  • 趋势形成后效果最好
  • 考虑市场环境适应性
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 167 lines · 53 tokens per session scan A d9199abb619e

Subscribe to this mod's changes

trend-following-timing is a skill published in the GitHub repository FeiCoder/Skill-Factory (10 stars, last pushed 6mo ago), licensed MIT. It adds 53 tokens to every session and 1,155 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories