2026-03-23 23:34:28 +05:30
|
|
|
/*!
|
|
|
|
|
ferro_ta_core — Pure Rust indicator library.
|
|
|
|
|
|
|
|
|
|
This crate contains all indicator implementations as pure functions operating
|
|
|
|
|
on `&[f64]` slices and returning `Vec<f64>`. It has **no dependency on PyO3
|
|
|
|
|
or numpy** so it can be used from any Rust project, or compiled to WASM /
|
|
|
|
|
Node.js via napi-rs without dragging in Python bindings.
|
|
|
|
|
|
|
|
|
|
The Python wheel (`ferro_ta` PyPI package) is built from a thin binding crate
|
|
|
|
|
that calls into this core and converts NumPy arrays to/from Rust slices.
|
|
|
|
|
|
|
|
|
|
# Two-layer architecture
|
|
|
|
|
|
|
|
|
|
The root crate (`ferro_ta`) contains PyO3 `#[pyfunction]` wrappers that convert
|
|
|
|
|
numpy arrays to `&[f64]` and delegate to this core crate.
|
|
|
|
|
|
|
|
|
|
# Usage (Rust)
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
use ferro_ta_core::overlap;
|
|
|
|
|
|
|
|
|
|
let close = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0];
|
|
|
|
|
let sma = overlap::sma(&close, 3);
|
|
|
|
|
assert!(sma[0].is_nan());
|
|
|
|
|
assert!((sma[2] - 2.0).abs() < 1e-10);
|
|
|
|
|
```
|
|
|
|
|
*/
|
|
|
|
|
|
2026-03-30 12:45:52 +05:30
|
|
|
pub mod aggregation;
|
|
|
|
|
pub mod alerts;
|
|
|
|
|
pub mod attribution;
|
|
|
|
|
pub mod backtest;
|
|
|
|
|
pub mod batch;
|
|
|
|
|
pub mod chunked;
|
|
|
|
|
pub mod commission;
|
|
|
|
|
pub mod crypto;
|
|
|
|
|
pub mod currency;
|
|
|
|
|
pub mod cycle;
|
|
|
|
|
pub mod extended;
|
2026-03-24 02:41:50 +05:30
|
|
|
pub mod futures;
|
2026-03-23 23:34:28 +05:30
|
|
|
pub mod math;
|
2026-03-30 12:45:52 +05:30
|
|
|
pub mod math_ops;
|
2026-03-23 23:34:28 +05:30
|
|
|
pub mod momentum;
|
2026-03-24 02:41:50 +05:30
|
|
|
pub mod options;
|
2026-03-23 23:34:28 +05:30
|
|
|
pub mod overlap;
|
2026-03-30 12:45:52 +05:30
|
|
|
pub mod pattern;
|
|
|
|
|
pub mod portfolio;
|
|
|
|
|
pub mod price_transform;
|
|
|
|
|
pub mod regime;
|
|
|
|
|
pub mod resampling;
|
|
|
|
|
pub mod signals;
|
2026-03-23 23:34:28 +05:30
|
|
|
pub mod statistic;
|
2026-03-30 12:45:52 +05:30
|
|
|
pub mod streaming;
|
2026-03-23 23:34:28 +05:30
|
|
|
pub mod volatility;
|
|
|
|
|
pub mod volume;
|