MCPcopy Create free account
hub / github.com/Open-Quant/openquant / bs_average_holding_period

Function bs_average_holding_period

crates/pyopenquant/src/backtest_stats.rs:90–96  ·  view source on GitHub ↗
(
    timestamps: Vec<String>,
    positions: Vec<f64>,
)

Source from the content-addressed store, hash-verified

88
89#[pyfunction(name = "average_holding_period")]
90fn bs_average_holding_period(
91 timestamps: Vec<String>,
92 positions: Vec<f64>,
93) -> PyResult<Option<f64>> {
94 let target = pair_timestamps_values(timestamps, positions, "timestamps", "positions")?;
95 Ok(openquant::backtest_statistics::average_holding_period(&target))
96}
97
98#[pyfunction(name = "bets_concentration")]
99fn bs_bets_concentration(returns: Vec<f64>) -> Option<f64> {

Callers

nothing calls this directly

Calls 2

pair_timestamps_valuesFunction · 0.85
average_holding_periodFunction · 0.85

Tested by

no test coverage detected