fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Financial Time-Series Foundations

10 algorithms in Financial Mathematics, Statistics, and Data Foundations · 10 with asserted arithmetic.

In this family#

  1. Time Order, Frequency, Regularity, and Financial Calendars verified

    Checks whether a timestamped series runs in chronological order and whether its observations are evenly spaced, reporting the common spacing in seconds when there is one.

    timeOrderFrequencyRegularityAndFinancialCalendars(input)
  2. Levels, Changes, Differences, and Returns verified

    Converts a level series into its period-over-period differences and its simple returns, keeping the original levels alongside them.

    levelsChangesDifferencesAndReturns(input)
  3. Lags, Leads, and Temporal Dependence verified

    Pairs every observation with the value lag positions behind it, and exposes the same series shifted forward as the lead.

    lagsLeadsAndTemporalDependence(input)
  4. Rolling and Expanding Windows verified

    Computes a fixed-length rolling mean of the series next to its expanding mean, so a window that forgets can be compared with one that never does.

    rollingAndExpandingWindows(input)
  5. Resampling, Aggregation, and Time Alignment verified

    Cuts the series into consecutive fixed-size buckets and averages each one, coarsening the sampling frequency.

    resamplingAggregationAndTimeAlignment(input)
  6. Trend, Seasonality, Cycles, and Remainder verified

    Separates a series into a rolling-mean trend, a seasonal difference taken period steps back, and the remainder left once the trend is removed.

    trendSeasonalityCyclesAndRemainder(input)
  7. Autocovariance and Autocorrelation verified

    Measures how far a series moves with its own past at a given lag, using the population convention that divides by the full observation count.

    autocovarianceAndAutocorrelation(input)
  8. Stationarity and Differencing Intuition verified

    Compares the average level of the second half of a series with the first half, and reports the first differences, as a rough read on whether the level drifts.

    stationarityAndDifferencingIntuition(input)
  9. Smoothing, Baselines, and Naive Forecasts verified

    Runs simple exponential smoothing over the series and reports both the naive last-value forecast and the smoothed one.

    smoothingBaselinesAndNaiveForecasts(input)
  10. Look-Ahead Leakage and Time-Aware Data Splits verified

    Splits a timestamped series at a given position and reports whether the training block reaches into the testing block's time range.

    lookAheadLeakageAndTimeAwareDataSplits(input)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { timeOrderFrequencyRegularityAndFinancialCalendars } from "fintech-algorithms/foundations/financial-time-series-foundations/time-order-frequency-regularity-and-financial-calendars";
import { levelsChangesDifferencesAndReturns } from "fintech-algorithms/foundations/financial-time-series-foundations/levels-changes-differences-and-returns";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Financial Mathematics, Statistics, and Data Foundations collects 120 algorithms across 12 families. For the concept behind this family rather than the call signatures, see the concept guides.