Skip to content
All library documents

Using Interactive Brokers Data for Backtests: Coverage and Data Limits

Article Lumibot

Summary

This guide describes how LumiBot retrieves and caches historical data from Interactive Brokers for backtesting. It covers futures, spot crypto, and routed daily stock or index data, as well as multi-provider routing. For stocks and indexes, it explains how the downloader handles paged history, market closures, new listings, missing cached sessions, delayed data, and corporate actions. It also discusses futures exchange selection and the offline contract-ID registry needed for some expired contracts.

The guide emphasizes data quality and operational caveats: some intraday history workflows are not fully supported in the public release, the integration remains under development, and access depends on IBKR’s market-data entitlements and authenticated sessions. Cached histories may be partial, and daily equity bars receive best-effort dividend and split data from another source. The document explains these mechanisms but provides no backtest results or evidence that any trading strategy is profitable.

Key ideas

  • LumiBot can use IBKR historical bars for supported futures and spot crypto, with routed support for daily stocks and indexes.
  • The downloader pages through history and attempts to repair missing sessions in cached data.
  • Daily stock bars may be enriched with dividend and split data from an external source.
  • Expired futures may require an offline contract-ID registry, and ambiguous exchange routing may need an explicit choice.
  • Coverage, entitlements, session status, and partial histories can limit backtest data availability.

Tags

Full text
# backtesting.ibkr


Interactive Brokers (REST) Backtesting
======================================

.. meta::
   :description: LumiBot supports backtesting with Interactive Brokers data providers.

LumiBot supports backtesting with **Interactive Brokers data providers**.

.. include:: _snippets/botspot_mcp_callout.rst

The primary data path uses Client Portal (REST) via the LumiBot Data Downloader.

Corporate-action metadata availability
-------------------------------------

IBKR ``TRADES`` stock and ETF prices are already split-adjusted. A missing or
stale auxiliary split/dividend ledger does not prevent those prices from being
used in a backtest. LumiBot keeps an explicitly unverified, dated price snapshot
separate from caches with verified corporate-action coverage. It does not infer
splits from market moves or mix incompatible adjustment bases.

When the optional metadata is unavailable, ``settings.json`` data-health warnings
record ``corporate_actions_status="unavailable"`` and
``cash_dividends_verified=false``. The backtest can continue, but it must not be
described as having complete cash-dividend accounting. Unknown action columns
are missing values, rather than proof that no dividends or splits occurred.
Available verified action metadata continues to support cash-dividend accounting.

Note: second-level and tick-level history are not yet a fully-supported end-to-end workflow in the open-source
distribution. (Some internal deployments may have additional adapters behind the same external ``/ibkr/*`` contract.)

For **expired futures** contract discovery (conids), LumiBot checks its mirrored contract registry first.
When REST does not list the requested expired month, a downloader with the read-only
``/ibkr/tws/secdef/contracts`` endpoint can resolve it through its existing TWS gateway.
The root, venue, currency and expiration month must match one unambiguous futures contract.
Discovery cannot extend IBKR's historical-data retention limits.

NG, CL and MCL discovery uses the exact last-trade date because it precedes
the delivery month. A completed TWS lookup without a matching identity has a
15-minute retry cooldown; a newly recovered positive registry entry takes
precedence. Timeouts and disconnects do not establish identity absence, and
unresolved identities never establish that historical prices did not exist.

Missing continuous-futures roll contracts are reported as partial history, even when later contracts supply bars.
Check the actual number of completed bars at the simulated decision time before applying a lookback indicator.
Shared registry writes preserve unrelated current identities and retry concurrent publication conflicts.
Futures weekend closure runs from Friday 17:00 through Sunday 18:00 New York time, across daylight-saving changes.

Downloader queue deadlines cover submission, polling, retry backoff and local concurrency waits together.
Normal requests allow three configured timeout windows. Requests with a finite attempt cap use that many windows;
resubmission does not restart the total deadline. If a replacement downloader explicitly reports
that an accepted read request no longer exists, the client resubmits the same logical read
after a bounded pause. Transient status errors keep waiting on the existing request. Already downloaded valid bars remain available for a later retry.

Status
------

IBKR REST backtesting is under active development and is not yet a fully-supported public workflow in the open-source
distribution.

If you want early access or have a specific use case, please open an issue (or contact the maintainers) so we can
prioritize it.

Quick Start
-----------

Select IBKR as the backtesting data source:

.. code-block:: bash

   export BACKTESTING_DATA_SOURCE="ibkr"

Supported Data
--------------

- **Futures**: US futures across CME/CBOT/COMEX/NYMEX via IBKR historical endpoints (minute/hour/day bars).
- **Spot crypto**: IBKR crypto bars (availability depends on region and IBKR product support).
- **Stocks / Indexes (day bars)**: supported in routed backtests (for example mixed Theta+IBKR routing).

Stock, index and futures intraday historical requests stop 20 minutes before
the backtest's captured start-of-run clock. Explicit and continuous futures use the same stable boundary,
including the pager's overlap offset. A window wholly inside that unavailable
interval returns empty bars with partial history health; unavailable prices
are never cached as confirmed absence. Daily bars, older historical windows
and real-time snapshot APIs retain their separate behavior.

Stock contract currency
-----------------------

When resolving a stock contract, LumiBot checks IBKR's contract details against
the requested quote currency instead of taking the first stock search result.
This supports USD and other requested currencies. A lookup with no matching
currency reports an error; it does not substitute another currency. Historical
contracts are not excluded because they are no longer tradable today.

This check applies to new contract lookups. Existing contract mappings and price
caches are not rewritten or revalidated by this change.

Portfolio Valuation (Stocks/Indexes)
------------------------------------

Daily-cadence backtests (for example ``sleeptime = "1D"``) value stock and index positions on the daily
series. Intraday backtests value them on the finest intraday bars loaded for that asset (the bars the
strategy requested and its fills use): the bar that has just completed marks at its close, a bar still forming
marks at its open. If the strategy's minute history ends before the current time, a small window of minute bars
is fetched first, the same request the strategy itself makes. Strategies that only use daily bars never fetch
minute history for valuation.

Daily futures candles aggregate intraday bars whose start time is inside the session,
including the opening boundary and excluding the closing boundary. A bar starting at
the close belongs to the next session and cannot change the completed candle's prices
or volume. This applies to both hourly aggregation and the minute fallback.

During known daily maintenance and weekend closures, futures valuation can
retain the last completed trade close. This fallback cannot bridge a missing
open-market interval or supply an executable bar.

Daily Stocks/Indexes: Warmup + Corporate Actions
------------------------------------------------

TWS daily bars use calendar-date labels encoded at UTC midnight. LumiBot preserves that session date
before converting to New York and exposes the candle at the existing daily close. New stock/index
daily cache filenames use ``_SESSION_DATE_V2.parquet`` to rebuild mixed legacy daily files from real
provider data. Old files remain available to older package versions; intraday and futures cache keys
are unchanged. Provider gaps still report partial history and are never filled with invented prices.


For routed daily stock/index backtests, LumiBot prefetches the full computed lookback window so long
lookbacks (for example 200-day SMA signals) are not under-warmed near the backtest start.

IBKR day-bar payloads do not include corporate-action columns directly. LumiBot enriches cached IBKR
daily equity bars with ``dividend`` and ``stock_splits`` values using Yahoo actions as a best-effort
source so split/dividend accounting remains available in backtests.

How History Is Downloaded (stocks and indexes)
----------------------------------------------

IBKR returns at most about 1,000 bars per request, so LumiBot walks backwards page by page.

- **Weekends, holidays and nights.** A 1-minute page covers 1,000 minutes (16.7 hours). A page that falls
  entirely inside closed-market time comes back empty; LumiBot steps over it and keeps going instead of treating it
  as the start of history. US indexes such as SPX only print 09:30 to 16:00 ET, so the same applies every night.
- **New listings.** When a daily page reaches back before the first bar IBKR holds, IBKR answers
  ``Chart data unavailable``. LumiBot retries with a smaller page and keeps the real bars it already has, so a
  fund listed last year still gets its full daily history.
- **A failed older page** keeps the newer real bars already downloaded; the missing older part is not faked and is
  retried by a later run.
- **Delayed feed.** IBKR stock, index and futures history can lag real time, so intraday requests
  stop 20 minutes before the captured start-of-run clock. A strategy decision requiring newer
  unavailable prices makes the run incomplete; it does not silently qualify a shortened result.
- **Daily windows** up to 993 days are one request sized to the window; longer windows use 5-year pages.
- **Dividends.** IBKR history has no corporate actions, so LumiBot adds dividends and splits to IBKR daily stock bars
  from a free corporate-actions source. BotSpot Auto backtests credit a held stock's dividend on its ex-date from
  those daily bars.
- **Holes in cached minute bars.** When the cache has bars on both sides of a missing session (for example from two
  earlier backtests, or a download that was stopped), LumiBot downloads each missing session instead of skipping it.
  A session with no trades at all is remembered for a day so it is not requested again by every backtest.
  Gap checks handle nanosecond, microsecond, millisecond and second cache timestamps consistently;
  existing Parquet caches do not need to be deleted or rewritten.

Continuous Futures: History and Held Contracts
---------------------------------------------

A continuous series supplies signal history. In IBKR backtests, an order submitted
for that series binds to the selected physical expiry. The position and its protective
orders retain that expiry after the continuous chart moves to the next contract.
There is no automatic roll trade and no profit from merely switching chart series.

To roll a position, close its ``position.asset`` and open the next contract explicitly.
A root-symbol closing order targets the single matching held contract. Multiple matching
expiries, or a reversal spanning different expiries, require explicit contracts.
Normal fills, fees and price availability apply to both legs.

A dated contract's history is loaded up to its last trading day, even when the backtest
runs past it, so orders on that contract fill on its real bars until it expires. This
holds for the direct IBKR source and for routed backtests, where a continuous future such as
``Asset("ES", asset_type="cont_future")`` resolves to the dated contract for fills and each
contract after a roll is loaded from a week before its first use. An order
still working after its contract's expiration date can never fill: the backtest cancels it
and logs ``[FILL][CANCEL] ... contract CL 2026-10-20 expired on 2026-10-20``. It shows as
canceled in the trades file. Contract details (multiplier, tick size) are looked up once
per contract per run.

History is downloaded in pages, newest first. If an older page fails for a temporary
reason, LumiBot asks for that same page again up to two more times, waiting a few seconds
between tries. If it still fails, the newer bars are kept, the missing range is listed in
the run's ``settings.json`` history health (reason ``older_history_page_unavailable``),
and the range is not requested again for the rest of the run. No bars are invented for it:
an order that needs a bar in that range waits for the next real bar (or expires by its
time in force), as with any other missing data.

Futures Exchange Routing (auto + override)
------------------------------------------

For futures and continuous futures (``asset_type="future"`` / ``asset_type="cont_future"``), LumiBot supports an
optional ``exchange=...`` parameter on the Strategy data methods:

- ``get_historical_prices(..., exchange=...)``
- ``get_last_price(..., exchange=...)``
- ``get_quote(..., exchange=...)``

When ``exchange`` is omitted, LumiBot attempts to resolve the correct futures exchange automatically via IBKR secdef
search (preferring USD + US venues). If results are ambiguous, you must pass ``exchange=...`` explicitly.

Expired Futures Contracts (conids)
----------------------------------

IBKR futures history requires a contract identifier (``conid``). IBKR Client Portal cannot reliably discover ``conid``
values for **expired** futures contracts, which makes explicit-contract backtests fail unless the mapping is already
known.

LumiBot supports an offline conid registry (cache-backed, optionally S3-mirrored):

- ``LUMIBOT_CACHE_FOLDER/ibkr/conids.json``

The registry is expected to **grow automatically over time** for new contracts as backtests run (using IBKR REST
endpoints). Very old expired contracts may still require a one-time offline backfill in internal deployments.

Internal runbook (engineering): ``docs/investigations/2026-01-18_IBKR_EXPIRED_FUTURES_CONID_BACKFILL.md``.

Caching
-------

IBKR backtests cache historical bars as Parquet:


- Optional S3 mirroring: configured via the standard ``LUMIBOT_CACHE_*`` variables (see :ref:`environment_variables`).

For US stock and index bars, LumiBot checks for cache gaps after loading the
series. Daily bars are compared with completed NYSE sessions and exact missing
session groups are repaired in small bounded windows under a 45-second
per-series deadline. Hourly bars are checked for internal holes longer than
seven days and repaired in bounded 2000-hour pages under a five-minute
per-series deadline. These checks never turn partial data into a backtest
exception, and complete warm caches do not call the downloader.

Dated futures intraday bars (1, 5, 15 and 30 minute series, each cached under its
own bar size) are checked the same way. A hole is a stretch of at least two hours
with the exchange open and no bar between two cached bars. Gaps are measured in
bars of the series: a 5 minute bar is labelled by its start, so the last bar
before the 17:00 ET close starts at 16:55 and nothing is missing until the
reopening. The daily maintenance break, weekends and exchange holiday halts are
closures and are never requested. A real hole is requested once per open stretch.
When the provider answers a hole with no bars at all, the cache keeps a dated
note (never a price) so later backtests do not ask again until the note expires
after 24 hours; a failed request writes nothing and is retried by the next
backtest. A backtest whose window is fully cached therefore starts without any
provider request, whatever the bar size:

.. code-block:: python

    # Served from the cached 5 minute series; weekends and holidays cost nothing.
    bars = self.get_historical_prices(asset, 300, "5 minutes")
    trend = self.indicators.supertrend(asset, length=10, multiplier=3.0, timestep="5 minutes")

History health is classified as ``complete``, ``partial``,
``confirmed_no_data``, or ``transient_failure``. Only confirmed absence may
create a durable no-data marker. That marker includes a reason and retry
timestamp. Partial and transient responses receive an in-process cooldown so
one backtest does not repeat the same downloader request, while a later process
remains able to retry. Legacy, ambiguous, and expired markers are eligible for
lazy repair. When a real bar and a no-data marker share a timestamp, the real
bar always wins.

Backtest ``settings.json`` artifacts include a credential-free ``data_health``
summary with up to 100 missing-session dates, the full missing-session count,
and repair outcomes. Free-form provider errors remain in logs.

The summary distinguishes optional prefetch gaps from history actually required
by a strategy. ``required_complete=false`` means a decision lacked its requested
completed bars, a consumed contract segment was unresolved, a held position had
no valuation price, or a decision required an unavailable delayed-feed tail.
Consumers must not present such a run as a valid completed result. A fully
supplied strategy that legitimately chooses no trades remains valid.

A lookback longer than a symbol's history is not missing data. When the provider
was asked for the earlier window, returned nothing before the first bar, and
there is no hole inside the bars it did return (for example a lookback of 200
daily bars on a symbol listed 60 sessions ago), the run stays valid. The strategy
receives the bars that exist, so it cannot signal on the longer lookback until
enough bars exist, and ``data_health`` lists the series under ``history_starts``
with ``first_available`` ("History for X starts on DATE"). A failed request,
a hole inside the returned bars, or no request for the earlier window still
fails the run.

**One asset without any bars on a date does not fail a multi-asset backtest.**
A ranking strategy over many symbols often asks for a name before it was listed
(for example a 2020 backtest that includes a company listed in September 2020),
after it was delisted, or under a symbol the provider does not know. On those
dates the strategy gets no bars for that asset (``None`` or an empty result), so
it cannot trade it; no price is invented and nothing is forward filled. LumiBot
logs one WARNING naming the asset and the first date, and ``data_health`` lists
it under ``skipped_assets`` with ``first_date``, ``last_date``, ``occurrences``
and ``reason``. The run still fails when no asset had any data at all (for
example the strategy's only symbol is wrong), and a temporary download failure
(such as a rate limit) still fails it, because then the data exists.

Daily requests never ask the provider for bars after the current time, and a
window with no finished session is not requested at all. A daily window that
lies wholly before the first bar the cache holds, ended at least 7 days ago and
came back empty (usually the days before a listing) is remembered in the shared
cache for 7 days, so later backtests do not wait in the download queue for the
same empty answer. Recent windows are never remembered, so a bar published later
is always picked up.

Conid lookups also maintain cache files under ``LUMIBOT_CACHE_FOLDER/ibkr``:

- ``conids.json`` stores successful conid resolutions.
- ``conids_negative.json`` stores short-lived negative markers for symbols IBKR cannot resolve.

Negative conid markers prevent long backtests from repeatedly retrying permanently unavailable symbols, such as
defunct equities returned by an external universe API. These lookup failures are treated as terminal no-data
conditions for the affected request window, not as synthetic price data.

Multi-provider routing (Theta + IBKR)
-------------------------------------

To use multiple providers in a single backtest (example: ThetaData for options/stocks/indexes and IBKR for futures/crypto), set a JSON mapping in ``BACKTESTING_DATA_SOURCE``:

.. code-block:: bash

   export BACKTESTING_DATA_SOURCE='{"default":"thetadata","stock":"thetadata","option":"thetadata","index":"thetadata","future":"ibkr","cont_future":"ibkr","crypto":"ibkr","crypto_future":"ibkr"}'

Routing values are case/whitespace/_/- insensitive. For crypto, you may also route to documented CCXT backtesting paths by using either ``"ccxt"`` (auto-select exchange) or a supported CCXT backtesting exchange id directly (for example: ``"kraken"`` or ``"binance"``).

Option lookups follow the ``"option"`` route (or ``"default"`` when no option route is set): option chains (``get_chains()``), quotes and prices all come from that one provider. Chains are available from ``thetadata``, ``alpaca`` and ``polygon``; routing options to a provider without option chains raises a clear error naming that provider instead of silently using another one.

Crypto futures and perpetuals
-----------------------------

For ``Asset.AssetType.CRYPTO_FUTURE`` backtests routed to a spot provider (for example ``ibkr`` or ``coinbase``), LumiBot loads spot history of the same pair as a price proxy (``BTCUSDT`` reads ``BTC/USDT``). The log states when a spot proxy is used. A spot proxy has no contract terms and no funding history, so perpetual orders on these routes are rejected. To trade perpetuals with leverage, margin and funding, route ``crypto_future`` to ``bitunix`` or use ``CcxtBacktesting``; see :doc:`backtesting.perpetuals`.

Market Data Subscriptions (IBKR)
--------------------------------

IBKR requires appropriate **market data entitlements** to access market data via the API. IBKR notes that historical bars are part of Level 1 entitlements and that **crypto does not require additional market data subscriptions**:

- https://www.interactivebrokers.com/campus/ibkr-api-page/market-data-subscriptions/

For **CME futures** (ES/MES/NQ/MNQ), note that the cheap **CME S&P Indices** subscription is for index data, not futures contracts. Professional subscriber pricing and package availability can differ, so confirm your exact costs in the IBKR Market Data Subscriptions page and pricing table:

- https://www.interactivebrokers.com/en/pricing/market-data-pricing.php

Authentication / Session Behavior
---------------------------------

The Client Portal Gateway is session-based; if the session becomes unauthenticated, the gateway must be re-authenticated. IBKR documents the expected authentication lifecycle and recommends using ``/iserver/auth/ssodh/init`` to re-authenticate in most scenarios:

- https://www.interactivebrokers.com/campus/trading-lessons/launching-and-authenticating-the-gateway/

Configuration Notes
-------------------

Common environment variables for IBKR REST backtesting:

- ``IBKR_HISTORY_SOURCE`` (default: ``Trades``)
- ``IBKR_FUTURES_EXCHANGE`` (default: ``CME``; fallback when auto-routing fails)
- ``IBKR_CRYPTO_VENUE`` (default: ``ZEROHASH``)
- ``LUMIBOT_IBKR_ENABLE_FUTURES_BID_ASK`` (default: disabled; opt-in quote derivation for futures)

See :ref:`environment_variables` for details.


Continuous history and tradable positions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Continuous-futures history switches contracts on the configured roll schedule.
An IBKR backtest order resolves to a physical expiry when submitted. Its fills,
protective children and held position keep that expiry; a change in the history
series does not itself trade or change position value. Close the held contract
and submit the replacement explicitly when the strategy intends to roll. Both
fills use their own observed contract prices and configured fees.

A root-symbol closing order targets a single matching held expiry. If several
opposite positions exist, or a reversal would span different expiries, use
explicit ``position.asset`` contracts and separate orders. The simulator rejects
ambiguous operations rather than silently choosing a different financial result.

Frequently asked questions
--------------------------

Can I backtest with Interactive Brokers data in LumiBot?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yes, with limits. Set ``BACKTESTING_DATA_SOURCE=ibkr``. LumiBot reads IBKR history through Client Portal (REST) using the LumiBot Data Downloader. IBKR REST backtesting is still under active development and is not yet a fully supported public workflow in the open source release.

What IBKR data can I backtest?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

US futures on CME, CBOT, COMEX and NYMEX with minute, hour and day bars, plus spot crypto bars where IBKR offers them. Daily stock and index bars work in routed backtests, for example ThetaData plus IBKR. Second and tick level history is not yet a fully supported workflow.

Do I need IBKR market data subscriptions?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yes. IBKR requires market data entitlements to return data through its API. IBKR says historical bars are part of Level 1 entitlements and that crypto needs no extra subscription. See IBKR's `market data subscriptions page <https://www.interactivebrokers.com/campus/ibkr-api-page/market-data-subscriptions/>`__ and `pricing table <https://www.interactivebrokers.com/en/pricing/market-data-pricing.php>`__ to confirm your costs.

What is a conid, and why do expired futures need one?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A conid is IBKR's contract ID. IBKR needs it to return futures history, but Client Portal cannot reliably find conids for expired contracts. LumiBot keeps a registry at ``LUMIBOT_CACHE_FOLDER/ibkr/conids.json`` that grows as backtests run, so known expired contracts can still be tested.

How do I use ThetaData and IBKR in the same backtest?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Set ``BACKTESTING_DATA_SOURCE`` to a JSON map that names a source per asset type, as shown in Multi-provider routing above. For example, route stocks, options and indexes to ``thetadata`` and futures and crypto to ``ibkr``.

Does IBKR history include dividends and splits?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IBKR ``TRADES`` stock and ETF prices are already split adjusted, but IBKR day bars have no dividend columns. LumiBot adds dividend and split values to cached IBKR daily stock bars from Yahoo actions as a best effort source. If that data is unavailable, the backtest still runs and ``settings.json`` notes that cash dividends were not verified.

Why do my intraday IBKR bars stop 20 minutes before the run started?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IBKR stock, index and futures history can lag real time. LumiBot stops intraday requests 20 minutes before the clock captured when the run started, so it never caches prices that were not yet available.

Does LumiBot roll my continuous futures position for me?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No. The continuous series only supplies history. An order binds to one real expiry, and the position keeps that expiry. To roll, close ``position.asset`` and open the next contract with your own orders.

How do I choose the futures exchange?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

LumiBot tries to find it automatically, preferring USD and US venues. If the result is unclear, pass ``exchange=...`` to ``get_historical_prices()``, ``get_last_price()`` or ``get_quote()``. ``IBKR_FUTURES_EXCHANGE`` (default ``CME``) is used when automatic routing fails.


5, 10, 15 and 30-minute stock bars from loaded minute bars
----------------------------------------------------------

In a routed backtest that uses this route for stocks and ETFs, a request for 5, 10, 15 or
30-minute bars is answered from the 1-minute bars the run has already loaded, instead of
downloading a second series, when the answer is identical: every requested bar, and the bar
right before the oldest one, is a finished bar of today's regular session (09:30 to 16:00
New York), and every minute in them traded.

.. code-block:: python

    # At 10:30 with minute bars loaded: 10:15, 10:20 and 10:25, no extra download.
    bars = self.get_historical_prices("SPY", 3, "5 minutes")

Limits:

- A request that reaches before the open (for example 20 five-minute bars at 10:00), includes
  the first bar of the day, or comes after the close downloads the provider series as before,
  because pre-market and after-hours bars are not equal to bars rebuilt from minutes. Once
  downloaded, that series is always used.
- Stocks and ETFs only. Futures, options, crypto, hourly and daily bars are unchanged.
- On by default. ``BACKTESTING_INTRADAY_BARS_FROM_MINUTES=false`` turns it off.

Shown in full with attribution under the source's licence. Licence: GPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.