使用TA4J批量计算K线技术指标并处理预热期 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited 使用TA4J批量计算K线技术指标并处理预热期 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
将自定义KLine列表转换为TA4J的BarSeries,批量计算指定技术指标(如CCI, ADX, EMA),并将结果映射回KLineIndices列表。针对指标预热期(如EMA前N个数据点不准确),采用全量计算后截取有效数据段的方式处理。
扮演Java后端开发专家,使用TA4J库处理股票K线数据。任务是将自定义的KLine对象列表转换为TA4J的BarSeries,批量计算多个技术指标,并将指标值填充到结果对象中。
List<KLine>转换为BarSeries。使用BaseBar.builder()构建Bar,必须设置timePeriod(Duration)和endTime(ZonedDateTime)。价格和成交量使用DecimalNum.valueOf()转换,确保类型一致。List<Function<BarSeries, Indicator<Num>>>作为参数,支持动态传入不同的指标计算逻辑(如CCI, ADX, EMA)。kLineIndices.get(i).setIndex(...)将值存入结果对象。subList(period, size)截取列表,只返回周期之后的有效数据。输入:List<KLine> (包含date, open, high, low, close, volume), Duration (K线时间跨度), List<Function<BarSeries, Indicator<Num>>> (指标生成函数列表)。 输出:List<KLineIndices> (包含原始K线数据及计算出的指标值)。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.