@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
29 lines (28 loc) • 909 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WilliamsROptionsSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for Williams %R calculation options
*/
exports.WilliamsROptionsSchema = zod_1.z.object({
/**
* Array of high prices
*/
high: zod_1.z.array(zod_1.z.number()).min(1, 'High prices array must contain at least one value'),
/**
* Array of low prices
*/
low: zod_1.z.array(zod_1.z.number()).min(1, 'Low prices array must contain at least one value'),
/**
* Array of closing prices
*/
close: zod_1.z.array(zod_1.z.number()).min(1, 'Close prices array must contain at least one value'),
/**
* Period for Williams %R calculation (typically 14)
*/
period: zod_1.z.number()
.int('Period must be an integer')
.positive('Period must be positive')
.default(14)
});