@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
43 lines (42 loc) • 1.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StochasticResultSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for Stochastic Oscillator calculation result
*/
exports.StochasticResultSchema = zod_1.z.object({
/**
* Array of %K values (0-100)
*/
percentK: zod_1.z.array(zod_1.z.number().min(0).max(100)),
/**
* Array of %D values (SMA of %K, 0-100)
*/
percentD: zod_1.z.array(zod_1.z.number().min(0).max(100)),
/**
* Array of highest high values in the period
*/
highestHigh: zod_1.z.array(zod_1.z.number()),
/**
* Array of lowest low values in the period
*/
lowestLow: zod_1.z.array(zod_1.z.number()),
/**
* K period used
*/
kPeriod: zod_1.z.number(),
/**
* D period used
*/
dPeriod: zod_1.z.number(),
/**
* Number of Stochastic values calculated
*/
count: zod_1.z.number(),
/**
* Indices where Stochastic values correspond to original prices
* percentK[i] corresponds to prices[indices[i]]
*/
indices: zod_1.z.array(zod_1.z.number())
});