toraniko-styles

Crates.iotoraniko-styles
lib.rstoraniko-styles
version0.1.3
created_at2025-12-22 15:23:30.934869+00
updated_at2025-12-23 21:01:42.863623+00
descriptionStyle factor implementations for the toraniko factor model
homepagehttps://github.com/factordynamics/toraniko-rs
repositoryhttps://github.com/factordynamics/toraniko-rs
max_upload_size
id1999871
size60,282
refcell (refcell)

documentation

README

toraniko-styles

Style factor implementations for the toraniko factor model.

Factors

  • Momentum: Exponentially-weighted cumulative returns with lag
  • Size: Log market cap (SMB-style, negated so small = positive)
  • Value: Composite of book/price, sales/price, cash flow/price

Usage

use toraniko_styles::{MomentumFactor, SizeFactor, ValueFactor};
use toraniko_traits::Factor;

let mom = MomentumFactor::new();
let scores = mom.compute_scores(data)?;

Configuration

Each factor has a Config type with sensible defaults:

use toraniko_styles::{MomentumConfig, MomentumFactor};
use toraniko_traits::StyleFactor;

let config = MomentumConfig {
    trailing_days: 252,  // 1 year instead of default 504
    half_life: 63,       // 3 months instead of default 126
    lag: 20,
    winsor_factor: 0.01,
};
let mom = MomentumFactor::with_config(config);
Commit count: 0

cargo fmt