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

Function register

crates/pyopenquant/src/portfolio.rs:145–156  ·  view source on GitHub ↗
(py: Python<'_>, parent: &Bound<'_, PyModule>)

Source from the content-addressed store, hash-verified

143 tuple_bounds,
144 )
145 .map_err(to_py_err)?;
146 Ok((out.weights, out.portfolio_risk, out.portfolio_return, out.portfolio_sharpe))
147}
148
149/// Least-risk portfolio from a price matrix whose expected return is at least a target.
150///
151/// Solves `min w' Sigma w` subject to `mu' w >= target_return`, `sum(w) = 1` and the
152/// bounds. A target below the minimum-variance portfolio's return yields that portfolio.
153/// Returns are simple returns and both `mu` and `Sigma` are annualised with 252 periods a
154/// year (daily rows), so `target_return` is an annual figure. Markowitz (1952); AFML
155/// chapter 16.
156///
157/// Parameters
158/// ----------
159/// prices : list[list[float]]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected