@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.MACDResultSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for MACD (Moving Average Convergence Divergence) calculation result
*/
exports.MACDResultSchema = zod_1.z.object({
/**
* Array of MACD line values (fast EMA - slow EMA)
*/
macdLine: zod_1.z.array(zod_1.z.number()),
/**
* Array of signal line values (EMA of MACD line)
*/
signalLine: zod_1.z.array(zod_1.z.number()),
/**
* Array of histogram values (MACD line - signal line)
*/
histogram: zod_1.z.array(zod_1.z.number()),
/**
* Fast EMA period used
*/
fastPeriod: zod_1.z.number(),
/**
* Slow EMA period used
*/
slowPeriod: zod_1.z.number(),
/**
* Signal EMA period used
*/
signalPeriod: zod_1.z.number(),
/**
* Number of MACD values calculated
*/
count: zod_1.z.number(),
/**
* Indices where MACD values correspond to original prices
* macdLine[i] corresponds to prices[indices[i]]
*/
indices: zod_1.z.array(zod_1.z.number())
});