pfopt_* tool: expected return and covariance estimates (historical, EMA, CAPM; sample, semi, exponential, robust, Ledoit-Wolf and oracle shrinkage), mean-variance optimisation (max Sharpe, min volatility, target risk or return, quadratic utility) with bounds, shorting, market neutrality, sector and linear constraints and L2, transaction-cost and tracking-error terms, the efficient frontier, semivariance, CVaR and CDaR optimisation, the critical line algorithm, hierarchical risk parity, Black-Litterman with views and whole-share allocation. It runs on Fincept’s servers; your agent sends numbers or data references and gets back a result envelope with tables and charts.
Fincept Portfolio Optimizer tools are free. They count toward the rate limit only; a
$fincept reference inside a call is charged like a direct call to that tool.Modules
Tools are grouped in modules. Each module is a toolset namedpfopt_<module>, so you can list it or search within it. The Fincept Portfolio Optimizer reference lists every module and tool.
pfopt_catalog returns the live list of modules and tools from inside your agent.
Inputs
Estimates are annualised with
frequency periods per year: 252 (the default) for daily data, 52 weekly, 12 monthly.
Limits
A computation that runs past its time limit answers
timeout; a busy engine answers busy and the call can be retried a few seconds later.
Outputs
Optimisers return the weights as a table and bar chart with the expected annual return and the risk they optimise (volatility and Sharpe ratio, semideviation and Sortino ratio, CVaR or CDaR).pfopt_efficient_frontier and pfopt_cla return the frontier as a series with a line chart; pfopt_hrp adds the linkage, the dendrogram and the clustered correlation heatmap. pfopt_expected_returns and pfopt_risk_model return estimates you can pass straight back as expected_returns and cov_matrix. pfopt_discrete_allocation returns the shares per asset, the leftover cash and the error against the targets.
Example
Prompt
max Sharpe portfolio, finds pfopt_mean_variance and pfopt_discrete_allocation, and passes each stock’s closes as a $fincept reference to market_get_candles, one prices column per stock.