@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
36 lines (35 loc) • 1.12 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StochasticOptionsSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for Stochastic Oscillator calculation options
*/
exports.StochasticOptionsSchema = 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 %K calculation (typically 14)
*/
kPeriod: zod_1.z.number()
.int('K period must be an integer')
.positive('K period must be positive')
.default(14),
/**
* Period for %D calculation (typically 3)
*/
dPeriod: zod_1.z.number()
.int('D period must be an integer')
.positive('D period must be positive')
.default(3)
});