import type { array } from "../types"; /** * True Time-weighted return. * * True Time-weighted return measures the returns of the assets irrespective of the amount invested. * It eliminates the impact of cash flows, focusing solely on the performance of the investments themselves. * * @param mv Array of market values at each time period * @param cf Array of external cash flows (inflows/outflows) or a single number applied to all periods (defaults to 0) * @returns Time-weighted return * @throws If market values and cash flows arrays have different lengths * * @example Calculate true time-weighted return with market values and cash flows * ```ts * import { assertEquals } from "jsr:@std/assert"; * * const mv = [250000, 255000, 257000, 288000, 293000, 285000]; * const cf = [0, 0, 25000, 0, -10000, 0]; * assertEquals(twr(mv, cf), 0.07564769566198049); * * ``` * * @example TWR with no cash flows (default behavior) * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(twr([100, 110, 120]), 0.19999999999999996); * * ``` * * @example TWR with uniform cash flow * ```ts * import { assertEquals } from "jsr:@std/assert"; * * assertEquals(twr([100, 110, 120], 5), 0.0931677018633541); * ``` */ export default function twr(mv: array, cf?: array | number): number; //# sourceMappingURL=twr.d.ts.map