53566b9d82
Move several hot Python analysis paths to Rust-backed helpers. This adds Rust implementations for backtest strategy signal generation and the core portfolio loop, options and futures payoff aggregation, Greeks aggregation, ratio calculation, trade extraction, chunked close-only indicator runs, and forward-fill helpers. Wire the Python analysis and data modules to prefer these paths, and add coverage for the new batch fast path. Expand the WASM package to export WMA, ADX, and MFI from ferro_ta_core, refresh the Node examples, benchmarks, and README, and add a Node-vs-Python conformance test so the browser and node surface stays aligned with the main Python package. Introduce a generated cross-surface API manifest in docs/, along with scripts to rebuild and verify it from source exports. Enforce manifest freshness in the Python and WASM CI workflows so release candidates catch surface drift before push.
77 lines
3.0 KiB
Rust
77 lines
3.0 KiB
Rust
pub mod aggregation;
|
|
pub mod alerts;
|
|
pub mod attribution;
|
|
pub mod backtest;
|
|
pub mod batch;
|
|
pub mod chunked;
|
|
pub mod crypto;
|
|
pub mod cycle;
|
|
pub mod extended;
|
|
pub mod futures;
|
|
pub mod math_ops;
|
|
pub mod momentum;
|
|
pub mod options;
|
|
pub mod overlap;
|
|
pub mod pattern;
|
|
pub mod portfolio;
|
|
pub mod price_transform;
|
|
pub mod regime;
|
|
pub mod resampling;
|
|
pub mod signals;
|
|
pub mod statistic;
|
|
pub mod streaming;
|
|
pub mod validation;
|
|
pub mod volatility;
|
|
pub mod volume;
|
|
|
|
use pyo3::prelude::*;
|
|
|
|
/// ferro_ta — A fast Technical Analysis library powered by Rust.
|
|
///
|
|
/// Indicators are organized into modules matching the TA-Lib category structure:
|
|
/// - **overlap** : Overlap Studies (SMA, EMA, WMA, DEMA, TEMA, TRIMA, KAMA, T3, MACD, BBANDS, SAR, MA, MAVP, MAMA, SAREXT, MACDEXT, …)
|
|
/// - **momentum** : Momentum Indicators (RSI, STOCH, ADX, CCI, WILLR, AROON, MFI, …)
|
|
/// - **volume** : Volume Indicators (AD, ADOSC, OBV)
|
|
/// - **volatility** : Volatility Indicators (ATR, NATR, TRANGE)
|
|
/// - **statistic** : Statistic Functions (STDDEV, VAR, LINEARREG, BETA, CORREL, …)
|
|
/// - **price_transform**: Price Transformations (AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE)
|
|
/// - **pattern** : Pattern Recognition (CDLDOJI, CDLENGULFING, CDLHAMMER, …)
|
|
/// - **cycle** : Cycle Indicators (HT_TRENDLINE, HT_DCPERIOD, HT_DCPHASE, HT_PHASOR, HT_SINE, HT_TRENDMODE)
|
|
/// - **batch** : Batch Execution (batch_sma, batch_ema, batch_rsi — 2-D array input)
|
|
/// - **streaming** : Streaming Indicators (StreamingSMA, StreamingEMA, … — bar-by-bar PyO3 classes)
|
|
/// - **extended** : Extended Indicators (VWAP, SUPERTREND, DONCHIAN, ICHIMOKU, …)
|
|
/// - **math_ops** : Rolling Math Operators (rolling_sum, rolling_max, rolling_min, …)
|
|
/// - **resampling** : OHLCV resampling helpers (volume_bars, ohlcv_agg)
|
|
/// - **aggregation** : Tick/trade aggregation pipeline (aggregate_tick_bars, aggregate_volume_bars_ticks, aggregate_time_bars)
|
|
/// - **portfolio** : Portfolio analytics (portfolio_volatility, beta_full, rolling_beta, drawdown_series, correlation_matrix, relative_strength, spread, zscore_series, compose_weighted)
|
|
/// - **signals** : Signal helpers (rank_series, top_n_indices, bottom_n_indices)
|
|
#[pymodule]
|
|
fn _ferro_ta(m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|
pyo3_log::init();
|
|
overlap::register(m)?;
|
|
momentum::register(m)?;
|
|
volume::register(m)?;
|
|
volatility::register(m)?;
|
|
statistic::register(m)?;
|
|
price_transform::register(m)?;
|
|
pattern::register(m)?;
|
|
cycle::register(m)?;
|
|
batch::register(m)?;
|
|
streaming::register(m)?;
|
|
extended::register(m)?;
|
|
math_ops::register(m)?;
|
|
options::register(m)?;
|
|
futures::register(m)?;
|
|
resampling::register(m)?;
|
|
aggregation::register(m)?;
|
|
portfolio::register(m)?;
|
|
signals::register(m)?;
|
|
alerts::register(m)?;
|
|
crypto::register(m)?;
|
|
chunked::register(m)?;
|
|
regime::register(m)?;
|
|
attribution::register(m)?;
|
|
backtest::register(m)?;
|
|
Ok(())
|
|
}
|