@railpath/finance-toolkit
Version:
Production-ready finance library for portfolio construction, risk analytics, quantitative metrics, and ML-based regime detection
33 lines (32 loc) • 907 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ATRResultSchema = void 0;
const zod_1 = require("zod");
/**
* Schema for Average True Range (ATR) calculation result
*/
exports.ATRResultSchema = zod_1.z.object({
/**
* Array of True Range values
* Length: min(high.length, low.length, close.length)
*/
trueRange: zod_1.z.array(zod_1.z.number().min(0)),
/**
* Array of ATR values
* Length: min(high.length, low.length, close.length)
*/
atr: zod_1.z.array(zod_1.z.number().min(0)),
/**
* The period used for calculation
*/
period: zod_1.z.number(),
/**
* Number of ATR values calculated
*/
count: zod_1.z.number(),
/**
* Indices where ATR values correspond to original prices
* atr[i] corresponds to prices[indices[i]]
*/
indices: zod_1.z.array(zod_1.z.number())
});