UNPKG

@railpath/finance-toolkit

Version:

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

21 lines (20 loc) 679 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SMAOptionsSchema = void 0; const zod_1 = require("zod"); /** * Schema for Simple Moving Average (SMA) calculation options */ exports.SMAOptionsSchema = zod_1.z.object({ /** * Array of price values (typically closing prices) */ prices: zod_1.z.array(zod_1.z.number()).min(1, 'Prices array must contain at least one value'), /** * Period for the moving average calculation * Must be positive and not exceed the length of prices array */ period: zod_1.z.number() .int('Period must be an integer') .positive('Period must be positive') });