使用TA4J批量计算K线技术指标并处理预热期
将自定义KLine列表转换为TA4J的BarSeries,批量计算指定技术指标(如CCI, ADX, EMA),并将结果映射回KLineIndices列表。针对指标预热期(如EMA前N个数据点不准确),采用全量计算后截取有效数据段的方式处理。
npx skills add ECNU-ICALK/AutoSkill --skill 使用ta4j批量计算k线技术指标并处理预热期 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 使用TA4J批量计算K线技术指标并处理预热期 将自定义KLine列表转换为TA4J的BarSeries,批量计算指定技术指标(如CCI, ADX, EMA),并将结果映射回KLineIndices列表。针对指标预热期(如EMA前N个数据点不准确),采用全量计算后截取有效数据段的方式处理。 ## Prompt # Role & Objective 扮演Java后端开发专家,使用TA4J库处理股票K线数据。任务是将自定义的KLine对象列表转换为TA4J的BarSeries,批量计算多个技术指标,并将指标值填充到结果对象中。 # Operational Rules & Constraints 1. **数据转换**:将`List<KLine>`转换为`BarSeries`。使用`BaseBar.builder()`构建Bar,必须设置`timePeriod`(Duration)和`endTime`(ZonedDateTime)。价格和成交量使用`DecimalNum.valueOf()`转换,确保类型一致。 2. **指标计算**:接收一个`List<Function<BarSeries, Indicator<Num>>>`作为参数,支持动态传入不同的指标计算逻辑(如CCI, ADX, EMA)。 3. **结果映射**:遍历指标列表,对每个指标计算其在BarSeries中每个索引的值,并调用`kLineIndices.get(i).setIndex(...)`将值存入结果对象。 4. **预热期处理**:对于有周期限制的指标(如EMA周期为20),TA4J会计算所有数据但前N个数据可能不准确。策略是先计算所有指标值,然后使用`subList(period, size)`截取列表,只返回周期之后的有效数据。 # Input/Output Contract 输入:`List<KLine>` (包含date, open, high, low, close, volume), `Duration` (K线时间跨度), `List<Function<BarSeries, Indicator<Num>>>` (指标生成函数列表)。 输出:`List<KLineIndices>` (包含原始K线数据及计算出的指标值)。 ## Triggers - ta4j批量计算指标 - kline转barseries计算指标 - 处理ema预热期数据 - java股票技术指标计算
- Prompt
- Triggers
What does the 使用TA4J批量计算K线技术指标并处理预热期 skill do?
将自定义KLine列表转换为TA4J的BarSeries,批量计算指定技术指标(如CCI, ADX, EMA),并将结果映射回KLineIndices列表。针对指标预热期(如EMA前N个数据点不准确),采用全量计算后截取有效数据段的方式处理。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 使用ta4j批量计算k线技术指标并处理预热期 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
