Public
Edited
Oct 30, 2023
Insert cell
Insert cell
{
const spAscendingDate = sp.sort(
(a, b) => new Date(a.Date) - new Date(b.Date)
);
const windowsOfFifteenPercentGrowth = [];

for (let index = 0; index < spAscendingDate.length - 1; ++index) {
const beginning = spAscendingDate[index];
const end = spAscendingDate[index + 1];

const growth = beginning["Close Number"] / end["Open Number"];

if (growth > 1.15) {
windowsOfFifteenPercentGrowth.push({
range: [beginning.Date, end.Date],
growth: growth
});
}
}
return windowsOfFifteenPercentGrowth;
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more