StockCorrelationView

StockCorrelationView

Plotting your own data (CSV)

Template data. Out of the box this widget draws SYM-A (seed 42) and SYM-B (seed 7) — deterministic synthetic series of 60 daily bars each from xframe::make_seeded_series(60, seed), different seeds standing in for different symbols. Same seed, same bars, every run; no network, no live market data. They are only stand-ins.

CSV format. One bar per line, date,open,high,low,close,volume. A header row is optional; when present, columns are matched by name in any order (date, timestamp, time, window_start, open, high, low, close, volume — anything else is ignored, so Massive aggregates exports load as-is). Dates are UTC: YYYY-MM-DD, YYYY/MM/DD, YYYY-MM-DD HH:MM:SS, or an epoch timestamp in seconds, milliseconds or nanoseconds. volume is optional (defaults to 0); without a date column, bars get sequential daily timestamps from 2026-01-01 UTC. Blank lines are skipped; malformed rows are skipped and counted.

date,open,high,low,close,volume
2026-11-02,150.00,151.20,149.40,150.60,1200000
2026-11-03,150.60,152.10,150.10,151.80,980000

Working example. add_series_csv() loads one file per symbol and appends it as a named series. Call clear_series() first to drop the template series. On failure it returns false and appends nothing. Add these lines after constructing the widget (see the working example above for the full program):

#include "StockCorrelationView.h"
widget.clear_series();
std::string err;
widget.add_series_csv("aapl_30d.csv", "AAPL", err);
widget.add_series_csv("msft_30d.csv", "MSFT", err);
widget.draw();

Clear / populate. widget.clear_series() removes every series; add_series_csv() populates it again, one file per symbol. item_count() reports the longest series length.

Full format spec, limits, and the notes for indicator and drawing widgets: Plotting your own data (CSV).