When I started building a quantitative backtesting and stock-screening system, I thought I would keep data collection, strategies, and factors in one project. Later, I realized I did not need as much data as I had expected. Daily bars from public sources were enough for many backtests. Most of the work came after downloading them: why two sources disagreed on the same session, whether a stock had changed tickers, how to align prices after a split, and which sessions were missing from each daily update.
Those issues were not specific to one strategy, but they affected all of them. Over roughly two months, I extracted market-data collection, reconciliation, and cleaning from the quant system and made openbars. It runs locally and gathers data from providers with free tiers, keeping both their raw bars and the organized results in a data directory you control. Backtests and screeners can reuse the same data instead of starting with another API integration.
From providers to local bars
The current release is v0.1.0 and the project is still pre-alpha. Daily collection runs for US equities, crypto, China A-shares, and Hong Kong. The US providers are Massive, Alpaca, and yfinance; crypto uses Binance and Coinbase; A-shares can use BaoStock, AKShare, or Tushare, with one primary source enabled at a time; yfinance is the Hong Kong primary source. An AKShare Hong Kong adapter can corroborate bars from Python but is not wired into the CLI. US hourly bars can also be collected into the raw layer, and Twelve Data supports hourly bars only. Choose markets and providers in the config, then add the required account credentials or API keys. plan lays out jobs against source coverage and quotas; run executes them.
After fetching, openbars keeps each provider's raw bars and request records. It resolves securities with stable instrument_id values and symbol mappings bounded by dates. A trading calendar separates market holidays from missing data. It then reconciles bars from multiple sources using source priority, field capabilities, and tolerances, selecting a canonical daily bar with its source, selection reason, and quality status.
Raw bars from each provider are stored separately in Parquet; cleaned and aligned data goes into a canonical layer. DuckDB provides query views, while SQLite keeps job, checkpoint, and quota state. You can read JSON from the local /api/v1 served by openbars serve, use the Python BarReader, query with DuckDB, or read Parquet with tools such as pandas and Polars. /api/v1/bars lets you choose canonical bars or one provider's raw bars; /api/v1/flags and /api/v1/quota return quality flags and quota snapshots. Use the canonical series as a common research input and inspect raw bars when you need to compare source responses.
The new interface has Dashboard, Chart, Flags, and Data sources pages: check coverage and quota, view bars, filter quality flags, and compare provider notes. These screenshots are from the static GitHub Pages demo, which uses synthetic TEST* data checked into the repository. Running openbars serve locally opens the same read-only pages over the data you have collected.
The Dashboard preview uses synthetic TEST symbols from the repository.*
The times on the Data sources page are the rules the program uses to label provisional and final data; the selected provider supplies the bars.
The page labels bars provisional or final by market: US bars become final at 00:00 ET the next day, crypto at 00:30 UTC, and China A-shares and Hong Kong 30 minutes after their respective closes. The code verifies that Massive grouped daily bars are ready at 00:00 ET the next day, and that Alpaca SIP requests for the current day stop 16 minutes before the present time; other providers are collected on a best-effort basis. freshness describes timeliness, and available_at records when a bar first became available for research. Quality flags separately mark source disagreements, spikes, missing volume, suspensions, or limit-up/limit-down sessions. After a run, use Dashboard to check progress and Flags to review bars that need attention.
When Massive returns DELAYED for a daily bar, OpenBars treats it as data that is not ready yet, without consuming the ordinary failure retry budget. By default, retries start at 00:15 ET the next day, run every 45 minutes, and stop after four retries or a 3.5-hour window. run --until-idle waits through that retry cycle; --no-wait exits so the next scheduled run can pick it up. The retry window is derived from the stored job, so a process restart does not reset it. When planning a backfill, OpenBars recognizes sessions already covered by non-terminal jobs instead of creating duplicates. Rewriting an identical canonical bar does not create a new version, and run reports count each instrument once per session even when multiple jobs covered it.
Design choices
Local-first, not hosted. The data directory belongs to whoever runs it, and each provider's key is your own. openbars operates no server, account, or API, and it does not distribute market data, which stays under each provider's terms. The cost is that everyone has to get their own keys and schedule their own jobs; the benefit is that data and credentials never go to a third party.
Keep both the raw layer and the canonical layer. If only the cleaned result were kept, there would be no way to go back and see what a source originally delivered. So each provider's raw bars are appended as immutable Parquet parts, and the canonical layer is a selection made on top of them. Writes use a temporary file and an atomic replace, the last writer wins on the same key, and DuckDB holds only views that can be deleted and rebuilt at any time. Prices and volumes are stored as fixed-point decimals, never binary floats.
Select whole bars; do not stitch fields or interpolate. For each instrument and trading day, the market's policy selects one complete bar from a single source. It does not combine one provider's price with another's volume, and crypto stays separate by exchange and is never merged. A missing trading day stays missing rather than being filled, and a suspicious bar is flagged rather than deleted. That way every bar a backtest uses can be traced to its source.
Timeliness, quality, and completeness are stated separately. freshness only says whether a bar is provisional or final. Quality problems are expressed by flags and quality_status, and the coverage on the dashboard is only observed coverage. None of the three substitutes for another.
The market-data problems it handles
A ticker can be reused. After one company delists, the same symbol may point to another company, and providers may record different symbols for the same security. openbars gives each security a stable ID and records the date range for each symbol mapping. Historical queries resolve the ticker against each date, keeping the two companies' bars in separate series.
Missing data needs a trading calendar. Weekends and holidays are not gaps; a missing bar on an expected session is. openbars uses each market's calendar to generate expected bars and schedule backfills. For an A-share suspension, it keeps the raw record but does not invent a canonical bar; it marks suspensions and limit-up or limit-down status.
Splits and dividends change historical prices. openbars stores corporate actions and fetch times to find ranges that need a refresh after a split. Reads can derive split- or dividend-adjusted prices, and A-share reads can derive qfq or hfq adjustments. Each market's policy selects a whole bar from a source; it does not combine one provider's price with another provider's volume. Disagreements leave an audit record and flags, so a backtest can trace the source, fallback use, suspected spikes, or missing volume.
The latest code adds deterministic repair rules: R1 assigns a security type to unknown instruments from the latest ticker-type observations; R2 closes placeholder symbol mappings superseded by a newer security; R3 plans merges for duplicate instruments; and R4 checks isolated one-day spikes. Each rule produces a plan first and defaults to preview. Applying changes requires an explicit apply mode, and per-rule change limits guard the run. This gives stale or duplicated identity records a traceable repair path instead of an unrecorded edit to the underlying tables.
Existing tools and paid data plans
A client such as yfinance is a quick way to download data from one source; for a one-off fetch, that is enough. I needed historical data from several sources that I could compare repeatedly and reuse across backtest projects. OpenBB offers a broader set of financial-data provider interfaces and a unified Python/API surface, with each provider supplying its own data, credentials, and limits (provider documentation). openbars focuses on ongoing local collection, raw-data retention, and multi-source reconciliation into a canonical series with an audit trail. The two approaches can work together. yfinance is also one of the providers openbars currently supports.
Free plans work well for backtests and daily research; the main differences are request limits, history length, and availability. Massive Basic is free and includes US end-of-day data, five requests per minute, and about two years of history; its paid plans add history, delayed data, and real-time data. Alpaca's free plan offers real-time IEX data, with a 15-minute delay through its API, and its paid plan covers all US exchanges. Both are a good place to start with US daily bars, upgrading as you need more history or lower latency. Plans and prices change, so check the current Massive plans and Alpaca plans.
For A-shares, OpenBars supports BaoStock, AKShare, and Tushare. BaoStock and AKShare do not require a token; Tushare's roughly 120-point tier provides unadjusted daily bars, usually updated between 3 and 5 p.m. on trading days. Financials, adjusted bars, and minute data have separate access requirements (Tushare update guide). Hong Kong daily bars use yfinance, with AKShare available as corroboration; crypto bars come from Binance or Coinbase and remain separate by exchange. The OpenBars data-source guide lists supported intervals, history, quotas, and terms.
Paid plans generally offer higher quotas, deeper history, broader coverage, and real-time access. Whether data can be displayed or used commercially depends on the provider's own license, and individual and business plans carry different rights (Massive Business). openbars is Apache-2.0 software for collecting and organizing data. Users fetch the market data through their own accounts, under each provider's terms.
Where it stands, and what it does not do
The current release is v0.1.0, pre-alpha, and the API may change at any time. Daily bars run for US equities, crypto, China A-shares, and Hong Kong; US hourly bars can be collected into the raw layer; the AKShare Hong Kong corroboration adapter is not wired into the CLI yet; and other non-daily intervals are still on the roadmap. Sources that have not been verified are best effort, with no promises.
It is not a trading terminal or an order system, it does not handle tick or real-time quotes, and it is not a backtesting framework; backtesting is done by other projects that read this data. openbars serve is a local read-only interface that binds only to the loopback address by default and neither fetches nor writes. Binding to a non-loopback address takes an explicit opt-in, and there is no built-in authentication or TLS, so exposing it means doing your own network isolation or reverse proxy.
How I would use it
Use openbars init to create a config, then openbars plan to preview jobs and request budgets. run collects data, backfill fills history, status shows jobs and checkpoints, and verify reports market coverage and source agreement. Put run in cron, a systemd timer, or a macOS LaunchAgent to update after each market's final window. For reads, use the local UI and /api/v1 from openbars serve, the Python BarReader, DuckDB, pandas, Polars, or Parquet files.
Every run or backfill writes a completion record under _status/ in the data directory, and openbars status --json prints the latest one. To connect updates to your own notifications or automation, configure a webhook to send the same status JSON with an HMAC-SHA256 signature; delivery results are written back to the status document.
I would use it for daily backtests across markets, strategy screening, and stock-selection rules. Factor research can add financial statements, filings, or macro data to the same workflow. OpenBars gives those projects one local place for provider selection, instrument identity, trading calendars, adjustments, and quality flags; the market data itself stays on my machine.
Separating the data layer lets strategies reuse the same validated, traceable bars.
Contribute
I maintain openbars and welcome real data cases, provider adapters, tests, and documentation. Open an issue or PR in the GitHub repository.