PortfolioBacktest

Helpers & Utilities · AiDotNet.Finance.Trading.Evaluation

Runs a policy through a portfolio environment deterministically and scores it. A “policy” is just state → action, so this evaluates a scripted baseline and a trained RL agent (s => agent.SelectAction(s, training:false)) the same way — the honest-eval seam for the greenfield trading-agent research: hold out a chronological tail, run each candidate, and compare on these metrics.

Methods

Method Summary
PortfolioBacktestResult Run(PortfolioManagerEnvironment<T> environment, Func<Vector<T>, Vector<T>> policy) Runs policy through environment for one full episode and returns its risk/cost-adjusted performance.