UNPKG

@railpath/finance-toolkit

Version:

Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection

53 lines (52 loc) 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BollingerBandsResultSchema = void 0; const zod_1 = require("zod"); /** * Schema for Bollinger Bands calculation result */ exports.BollingerBandsResultSchema = zod_1.z.object({ /** * Array of upper band values * Length: prices.length - period + 1 */ upperBand: zod_1.z.array(zod_1.z.number()), /** * Array of middle band values (SMA) * Length: prices.length - period + 1 */ middleBand: zod_1.z.array(zod_1.z.number()), /** * Array of lower band values * Length: prices.length - period + 1 */ lowerBand: zod_1.z.array(zod_1.z.number()), /** * Array of bandwidth values (upper - lower) * Length: prices.length - period + 1 */ bandwidth: zod_1.z.array(zod_1.z.number()), /** * Array of %B values (position of price relative to bands) * Length: prices.length - period + 1 * %B = (Price - Lower Band) / (Upper Band - Lower Band) */ percentB: zod_1.z.array(zod_1.z.number()), /** * The period used for calculation */ period: zod_1.z.number(), /** * Standard deviation multiplier used */ stdDevMultiplier: zod_1.z.number(), /** * Number of band values calculated */ count: zod_1.z.number(), /** * Indices where band values correspond to original prices * bands[i] corresponds to prices[indices[i]] */ indices: zod_1.z.array(zod_1.z.number()) });