moving_averages 0.1.0

Production-grade moving average algorithms implementation
Documentation

Moving Averages

Crates.io Documentation License

生产级移动平均算法库,支持多种移动平均算法实现。

特性

  • 支持三种移动平均算法:
    • 简单移动平均(SMA)
    • 指数移动平均(EMA)
    • 递归移动平均(RMA)
  • no_std 兼容
  • 线程安全设计
  • 高性能实现

安装

Cargo.toml中添加依赖:

[dependencies]

moving_averages = "0.1"

使用示例

use moving_averages::{Sma, Ema, Rma, MovingAverage};

let mut sma = Sma::<f64, 3>::new(); // 3期简单移动平均
let mut ema = Ema::new(0.5); // alpha=0.5的指数移动平均

sma.next(1.0);
ema.next(1.0);

文档

完整API文档请参考: docs.rs

许可证

本项目采用 WTFPL 许可证。