use-drawdown 0.1.0

Primitive drawdown vocabulary for RustUse quantitative crates
Documentation
  • Coverage
  • 100%
    23 out of 23 items documented1 out of 15 items with examples
  • Size
  • Source code size: 10.61 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 567.78 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-quant
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-drawdown

Primitive drawdown vocabulary for RustUse quantitative crates.

use-drawdown uses the convention current / peak - 1.0, capped at 0.0 for new highs. Drawdowns are therefore zero or negative finite f64 values.

Example

use use_drawdown::Drawdown;

let drawdown = Drawdown::from_peak_current(120.0, 90.0)?;
let maximum = Drawdown::maximum_from_values(&[100.0, 120.0, 90.0, 130.0])?;

assert_eq!(drawdown.value(), -0.25);
assert_eq!(maximum.value(), -0.25);
# Ok::<(), Box<dyn std::error::Error>>(())

Scope

Use this crate for drawdown values and small peak/current calculations. It does not implement performance analytics, reporting, or charts.

License

Licensed under either MIT or Apache-2.0.