twr(): number
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.
Calculate true time-weighted return with market values and cash flows
Calculate true time-weighted return with market values and cash flows
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);