UNPKG

@railpath/finance-toolkit

Version:

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

28 lines (27 loc) 771 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SMAResultSchema = void 0; const zod_1 = require("zod"); /** * Schema for Simple Moving Average (SMA) calculation result */ exports.SMAResultSchema = zod_1.z.object({ /** * Array of SMA values (length: prices.length - period + 1) * First SMA value starts at index (period - 1) */ sma: zod_1.z.array(zod_1.z.number()), /** * The period used for calculation */ period: zod_1.z.number(), /** * Number of SMA values calculated */ count: zod_1.z.number(), /** * Indices where SMA values correspond to original prices * sma[i] corresponds to prices[indices[i]] */ indices: zod_1.z.array(zod_1.z.number()) });