Published June 16, 2026 | Version v1

A Sliding Best-Window Algorithm for Identifying Time-of-Day Opportunity Density in Statistical Arbitrage

Authors/Creators

  • 1. BJF Trading Group Inc.

Description

Statistical arbitrage and latency arbitrage strategies exhibit strong time-of-day clustering: opportunities concentrate during certain hours of the trading day and disperse outside them. Practitioners traditionally identify these dense windows by manual visual inspection of intraday event distributions or by grid search over fixed-time slices anchored on session-open and session-overlap boundaries. Both methods rely on prior knowledge and fail when the dense window does not align with a market-structural boundary.

This paper develops a Sliding Best-Window (SBW) algorithm that identifies time-of-day opportunity density windows automatically, from streamed event data, with no prior assumption on window position or length. The algorithm scans a sliding window of variable length over time-of-day bucketed event counts and reports the (start, length) pair that maximises a density score function combining event count, window length, and a logarithmic count-saturation term.

We derive the density score function from a stated tradeoff between density and persistence, prove that the algorithm runs in O(B × |L|) time where B is the number of time-of-day buckets and |L| the cardinality of the candidate length set, and demonstrate the algorithm on calibrated synthetic datasets representing three canonical retail-trading opportunity patterns: a London-open burst, a London / New York overlap shoulder, and a bimodal distribution with two competing peaks. The algorithm is implemented as part of an open-source dashboard for retail-trading opportunity statistics, with reference implementations in JavaScript and SQL.

The SBW algorithm complements the BEQI broker-execution-quality methodology and the execution-time gap framework (Fesenko, 2026): BEQI characterises per-broker execution quality, the execution-time gap framework quantifies how much backtested edge survives at a given round-trip time, and SBW identifies the time-of-day window over which the strategy operates at peak density.

Keywords: statistical arbitrage, time-of-day patterns, sliding window algorithm, opportunity density, intraday seasonality, event stream analytics, retail forex execution.

JEL classification: C53, C81, G14, G15.

Files

best-window-paper.pdf

Files (436.1 kB)

Name Size Download all
md5:7fe186a78e6ea5b7de62749afce4c91e
392.7 kB Preview Download
md5:651d6209b46eab5e88c3a310374335bf
36.5 kB Download
md5:93850ff128954a82d85205eec1e58c92
6.9 kB Download

Additional details