Skip to content

Orchestrator

polars_ts.marl.orchestrator

MARLOrchestrator: chains risk, return, and allocation agents over a PortfolioEnv.

MARLResult dataclass

Output of a MARLOrchestrator run.

MARLOrchestrator

Orchestrates specialized agents over a portfolio environment.

At each step: 1. RiskAgent assesses per-asset volatility. 2. ReturnAgent predicts expected returns. 3. AllocationAgent combines risk/return into portfolio weights. 4. PortfolioEnv evaluates the resulting allocation.

Parameters

window_size Observation window for the environment and agents. risk_aversion Passed to AllocationAgent. transaction_cost Proportional cost for weight changes.

run(returns)

Run the multi-agent loop over a returns matrix.

Parameters

returns Array of shape (n_steps, n_assets).

Returns

MARLResult

run_from_dataframe(df, id_col='unique_id', time_col='ds', target_col='y')

Run from a polars panel DataFrame of prices.