Skip to main content

Data Monitoring

Overview​

The data monitoring module is responsible for acquiring, normalizing, and storing market data that feeds into the analysis engine.

Requirements​

  • Latency: Near real-time (< 1 minute delay)
  • Coverage: Forex major pairs + selected stocks/indices
  • Granularity: 1-minute candles, tick data where available
  • History: Minimum 30 days rolling window for backtesting
  • Reliability: Automatic reconnection, data gap detection

Watched Instruments​

Forex Pairs (Initial)​

PairSessionNotes
EUR/USDLondon + NYMost liquid, tight spreads
GBP/USDLondon + NYHigh volatility windows
USD/JPYTokyo + LondonTrend-following opportunities
AUD/USDSydney + LondonCommodity correlation

Indices (Future)​

IndexSessionNotes
S&P 500 (SPX)NYBroad market sentiment
NASDAQ 100 (NDX)NYTech sector proxy

Data Pipeline​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ API Source │────▢│ Normalizer │────▢│ Storage β”‚
β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ β€’ REST poll β”‚ β”‚ β€’ OHLCV fmt β”‚ β”‚ β€’ SQLite/TS β”‚
β”‚ β€’ WebSocket β”‚ β”‚ β€’ Timestamps β”‚ β”‚ β€’ Partitionedβ”‚
β”‚ β€’ Fallback β”‚ β”‚ β€’ Validation β”‚ β”‚ β€’ Indexed β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Schema​

CREATE TABLE candles (
id INTEGER PRIMARY KEY,
symbol TEXT NOT NULL,
timeframe TEXT NOT NULL, -- '1m', '5m', '15m', '1h'
timestamp DATETIME NOT NULL,
open REAL NOT NULL,
high REAL NOT NULL,
low REAL NOT NULL,
close REAL NOT NULL,
volume REAL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
UNIQUE(symbol, timeframe, timestamp)
);

CREATE INDEX idx_candles_symbol_time ON candles(symbol, timeframe, timestamp DESC);

Health Checks​

  • Data freshness monitoring (alert if > 5 min stale)
  • Gap detection and backfill
  • Source failover (primary β†’ secondary API)
  • Rate limit tracking per API key