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.
npx skills add FeiCoder/Skill-Factory --skill trend-following-timinggit clone --depth 1 https://github.com/FeiCoder/Skill-FactoryWrote 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.
[](https://agentmods.dev/skills/feicoder/skill-factory/trend-following-timing)<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>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.
| Model | Per session | Once 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 |
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.
What it actually says
趋势追踪择时
基本概念
趋势择时的基本思想来自技术分析,认为趋势存在延续性,找到趋势方向后跟随操作即可。
技术分析三假设
- 市场行为涵盖一切信息
- 价格沿趋势移动
- 历史会重演
技术指标分类
| 类型 | 说明 | 示例 |
|---|---|---|
| 趋势型 | 判断趋势方向 | 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年后)
| 指数 | 择时收益 | 持有收益 |
|---|---|---|
| 上证指数 | 明显超越 | 基准 |
| 深证成指 | 明显超越 | 基准 |
自适应均线特点
- 优点:适应不同波动形态
- 缺点:信号频繁,交易成本高
- 适用:小资金调仓
实践建议
指标选择
- 单一指标:推荐MA(4,40)或MACD
- 组合指标:4个趋势指标叠加
参数优化
- 分3个5年区间测试
- 选择稳定超越基准的参数
交易成本
- 考虑双边1%交易成本
- 权衡准确率和交易频率
注意事项
- 震荡市场易产生错误信号
- 需要设置止损
- 趋势形成后效果最好
- 考虑市场环境适应性
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.
- 8d ago First seen · 167 lines · 53 tokens per session scan A d9199abb619e
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.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.