pub fn run_mid_frequency_pipeline(
input: ResearchPipelineInput<'_>,
config: &ResearchPipelineConfig,
) -> Result<ResearchPipelineOutput, PipelineError>Expand description
Runs the events → signals → portfolio → risk → backtest pipeline on one instrument (see the module documentation for the stages and conventions, and for a worked example).
§Errors
PipelineError::EmptyInputiftimestamps,closeormodel_probabilitiesis empty.PipelineError::LengthMismatchifcloseandtimestamps,model_probabilitiesandclose,model_sidesandclose, the rows ofasset_pricesandtimestamps, orasset_namesand the columns ofasset_pricesdiffer in length.PipelineError::InvalidParameterifasset_priceshas fewer than 2 rows or no columns,cusum_threshold <= 0,num_classes < 2,confidence_levelis outside[0, 1](NaN included), orperiods_per_yearis not finite and > 0.PipelineError::NoEventsif the CUSUM filter selects no bar (including whenclosehas a single bar).PipelineError::InvalidParameteralso if amodel_probabilitiesentry is outside[0, 1], orcusum_thresholdorstep_sizeisNaN, infinite or<= 0.PipelineError::PortfolioAllocationif the max-Sharpe optimisation onasset_pricesfails.PipelineError::Riskis part of the signature but not reachable after validation. It is kept so that a risk-metric failure would surface as a typed error, not a panic, should the validation above and the risk metrics’ own checks ever drift apart.