# Data quality (Phase E)

## OHLC validation

Reject before insert when:

- non-finite OHLC
- `high < low`
- `high < max(open, close)`
- `low > min(open, close)`

## Duplicates

`INSERT OR IGNORE` on primary key — duplicates counted as `skippedDuplicate`, not overwritten.

## Completed candles only

OANDA importer filters `complete: true` (same as Phase C/D live path).

## Gaps

`detectUnexpectedGaps` flags intervals **> 4×** the bar length (M15 → 60 minutes).  
FX **weekends/holidays** often appear as large gaps — review reports; do not auto-fill.

## EUR_USD M15 dataset (2026-10-02 verification)

| Field | Value |
|-------|--------|
| source | oanda |
| symbol | EUR_USD |
| timeframe | M15 |
| first UTC | 2025-10-02T20:45:00.000Z |
| last UTC | 2026-10-02T20:15:00.000Z |
| row count | 24,863 |
| validation errors | 0 |
| duplicates on year run | 479 (from prior test overlap) |
| gap reports (threshold) | 54 (mostly session/weekend spacing) |
| volumeType | tick |
