/** * Rebalancing period for a portfolio. * * @typedef {"week"|"month"} Highcharts.PortfolioRebalancePeriodValue * @since next */ /** * A portfolio definition for performance charts. Weights are keyed by series * name and expressed as percentages of {@link Highcharts.Options#initialBudget}. * * @interface Highcharts.PortfolioOptions * @since next */ export interface PortfolioOptions { /** * The portfolio name. Used for the derived total series. * * @since next */ name: string; /** * The rebalancing period. At each period boundary, weights are compared to * the targets and rebalanced when drift exceeds the threshold. * * @since next * @default "week" */ rebalancePeriod?: 'week' | 'month'; /** * The maximum allowed drift from a target weight in percentage points. * When any asset exceeds this value at a period boundary, all holdings are * rebalanced to the target weights. * * @since next * @default 5 */ rebalanceThreshold?: number; /** * Target allocation weights keyed by series name. Values are relative * percentages and are normalized to sum to 100. * * @since next */ weights: Record; } declare module '../../Core/Options' { interface Options { /** * Portfolio definitions for performance charts. Each entry simulates * a portfolio from {@link Highcharts.Options#initialBudget} using * series prices matched by name, and adds a derived total series with * rebalance flags. * * @sample {highstock} stock/demo/performance-budget/ * Performance chart with portfolios * * @since next * @product highstock */ portfolios?: Array; } } declare module '../../Core/Series/SeriesOptions' { interface SeriesOptions { } } declare module '../../Core/Chart/ChartBase' { interface ChartBase { } } export default PortfolioRebalance; /** * Portfolio definitions for performance charts with an initial budget. Each * portfolio allocates the budget by series name, rebalances on a period and * threshold, and adds a derived total series named after the portfolio. * Rebalance dates are marked with flags on that series. * * @sample {highstock} stock/demo/performance-budget/ * Performance chart with portfolios * * @type {Array<*>} * @since next * @product highstock * @apioption portfolios */ /** * The portfolio name. Used for the derived total series. * * @type {string} * @since next * @product highstock * @apioption portfolios.name */ /** * The rebalancing period. At each period boundary, current weights are * compared to the targets. * * @type {string} * @since next * @default week * @product highstock * @validvalue ["week", "month"] * @apioption portfolios.rebalancePeriod */ /** * The maximum allowed drift from a target weight, in percentage points. When * any asset exceeds this value at a period boundary, all holdings are * rebalanced to the target weights. * * @type {number} * @since next * @default 5 * @product highstock * @apioption portfolios.rebalanceThreshold */ /** * Target allocation weights keyed by series name. Values are relative * percentages and are normalized to sum to 100. * * @type {Object.} * @since next * @product highstock * @apioption portfolios.weights */