Module 10 · Financial Time-Series Foundations Lesson 91 of 120

Time Order, Frequency, Regularity, and Financial Calendars

A trading calendar is not an evenly spaced stopwatch.

2:33 clip4:56:19–4:58:52 in the full courseWatch on YouTube

Transcript

21 sentences · select one to jump there

Check your understanding

Can a series be ordered but irregular?

Choose one answer

Code lab

Run it yourself

The lesson source in 7 languages. Edit it, run TypeScript and Python right here, and compare with the expected output.

091-time-order-frequency-regularity-and-financial-calendars.ts
Start from GitHub
/**
 * Fintech Math Bootcamp · Lesson 091 of 120
 * Time Order, Frequency, Regularity, and Financial Calendars
 * Module 10: Financial Time-Series Foundations
 *
 * Scenario: A trading calendar is not an evenly spaced stopwatch
 * Rule:     strict order: tᵢ>tᵢ₋₁; regularity depends on the declared clock
 *
 * Try it:   Can a series be ordered but irregular?
 *
 * Lesson article: https://thefintechbuilder.com/financial-mathematics-statistics-and-data-foundations/financial-time-series-foundations/time-order-frequency-regularity-and-financial-calendars/
 * Free course:    https://courses.thefintechbuilder.com
 * Synthetic teaching example, not financial advice or a production library.
 */

export function lesson091() {
  const days=[0,1,4]; // Thu, Fri, Mon on an elapsed-day axis
  const ordered=days.every((t,i)=>i===0 || t>days[i-1]);
  const gaps=days.slice(1).map((t,i)=>t-days[i]);
  const result={ordered,gaps,equalElapsedSpacing:gaps.every(g=>g===gaps[0])};
  return result;
}

export const checkedResult = {"ordered":true,"gaps":[1,3],"equalElapsedSpacing":false};

// Run this file directly: npx tsx lessons/10-financial-time-series-foundations/091-time-order-frequency-regularity-and-financial-calendars.ts
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop()!)) {
  console.log(JSON.stringify(lesson091(), null, 2));
}

Your output

Press Run to execute the code in your browser.

Expected output

{
  "ordered": true,
  "gaps": [
    1,
    3
  ],
  "equalElapsedSpacing": false
}

Prefer your own machine? Every file is in the course repository · open it in Codespaces.

Lesson notes

The rule

strict order: tᵢ>tᵢ₋₁; regularity depends on the declared clock