Optionaloptions: { countries?: string | string[] }Country code(s) for business calendar (holidays, resampling). Used when adapting data to business days.
CAGR-based capture ratio vs benchmark column. Matches Python openseries capture_ratio_func behavior: uses frame data as-is (no resample) with dynamic time_factor = observations / (span_days/365.25).
"up" | "down" | "both" (up/down or both = up/down)
Benchmark column index (-1 = last)
Optionalopts: { freq?: ResampleFreq }Optionalfreq?: ResampleFreqIf set, resample to period-end before computing (e.g. "ME" for monthly). When omitted, uses frame data as-is to match Python default.
Filters tsdf to retain only business days. Mutates in place.
OptionalweightStrat: LiteralPortfolioWeightingsMax drawdown per column (price series). Returns array of max drawdowns.
Date when max drawdown bottom occurs per column. Returns array of date strings (or undefined when no drawdown).
Ordinary Least Squares fit of y on x. Regresses tsdf column yColumn (dependent) on xColumn (explanatory). Matches Python openseries ord_least_squares_fit.
Column index of dependent variable y
Column index of exogenous variable x
Optionalopts: { fittedSeries?: boolean }OptionalfittedSeries?: booleanIf true, add fitted values as new column (default true)
Object with coefficient (slope), intercept, and rsquared
Resamples all constituents to business period-end frequency, then re-merges. Throws if any constituent is a return series.
Returns return columns (first element 0). Throws if mixed PRICE/RTRN.
Converts each column to drawdown series (value / running peak - 1). Operates on the frame's aligned tsdf. Call after mergeSeries and truncate so drawdown is computed on the truncated date range.
Optional_opts: { fromDate?: string; toDate?: string }Truncates frame and constituents to a common date range.
Truncation options
OptionalendCut?: stringNew last date (default: earliest last date if where includes 'after')
OptionalstartCut?: stringNew first date (default: latest first date of all constituents if where includes 'before')
Optionalwhere?: "before" | "after" | "both"Which end(s) to truncate when cuts not provided
Collection of aligned timeseries with portfolio and correlation methods.