@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
21 lines (20 loc) • 673 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EMAOptionsSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for Exponential Moving Average (EMA) calculation options
*/
exports.EMAOptionsSchema = 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 EMA 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')
});