Skip to content

Algorithm SDK

INTERVAL_MS

The length of one bar of your session’s timeframe, in milliseconds: 3,600,000 for H1.

declare const INTERVAL_MS: number;
function onIntervalClose() {
const dayAgo = new Date(TIME.getTime() - 24 * 60 * 60 * 1000);
log("Bars in a day", 24 * 60 * 60 * 1000 / INTERVAL_MS, "closes since then", prices(dayAgo).length);
}