How we can pull historical highest or lowest closed price for X number of period

Hi, If anyone happen to know how to pull the highest or lowest closed price for x number of period. I trying to pull highest of 9 period.

Exploring the forum I did found an example where High and Low price for x number period but not closed. any suggestion

const MovingHigh = require("./tools/MovingHigh");
const MovingLow = require("./tools/MovingLow");

class chandeKrollStop {
init() {
this.highestPrice = MovingHigh(this.props.Period);
this.lowestPrice = MovingLow(this.props.Period);


inputType: meta.InputType.BARS,