Juneteenth 2027 (June 19) falls on a Saturday and is observed on Friday
June 18, 2027, which is also the third Friday of June 2027. The futures
market hours database tracked Juneteenth through 6/19/2026 but was missing
6/18/2027, so ThirdFriday-based index expiries (ES, NQ, YM, RTY and their
micros) were not moved back, producing e.g. ES18M27 instead of ES17M27.
Add 6/18/2027 alongside every existing 6/19/2026 entry (earlyCloses,
lateOpens, bankHolidays, holidays). Same class of fix as #7164.
Add June 2027 regression contracts (last trade 2027-06-17) for ES, NQ,
YM, RTY, MES, MYM in the expiry test data.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Wait for first session bar before filling equity market orders at open
EquityFillModel.MarketFill could fill a market order placed right after
market open using data from the previous trading date, because the first
bar of the current session has not been emitted yet. ShouldWaitForFreshData
only covered hour/daily resolutions, so minute/second orders filled on stale
prices.
Add IsWithinFirstResolutionSpanAfterMarketOpen: when the order time is within
the lowest subscribed resolution span after the open and the price is stale,
wait for the first bar instead of filling on the previous date's price.
* Share opening-bar stale-fill wait across fill models
Move IsWithinFirstResolutionSpanAfterMarketOpen to the base FillModel and add
a ShouldWaitForFreshDataOnStale sibling helper that combines it with the
existing coarse-resolution ShouldWaitForFreshData check. The base FillModel,
FutureFillModel and EquityFillModel market fills now share this single wait
decision at their stale-data guards.
ShouldWaitForFreshData is intentionally left untouched at its GetMarketFillPrice
call site, which uses it to choose the bar open vs current price and is not
gated by staleness, so fill prices for finer resolutions are unchanged. The
opening-bar helper is guarded against always-open markets, which have no
session open to wait for.
* Add regression algorithm for stale fill at market open
Reproduces the opening-bar stale fill issue: a market order placed one second
after the open while subscribed to minute resolution. Without the fix the order
fills on the previous trading date's stale price; the algorithm asserts in
OnOrderEvent that a fill never happens within the first minute after the open,
so it errors without the fix and passes with it.
Uses SPY minute data over 2013-10-07 to 2013-10-11, which is available in the
repository Data folder.
* Add unit tests for stale fill wait at market open
Cover the opening-bar stale fill scenario directly at the fill model level:
a market order placed within the first bar after the session open, while only
the previous session's stale bar is available, must wait instead of filling on
the stale price, and fills once the first session bar arrives. EquityFillModel
also asserts the boundary (orders past the first bar still fill on stale data),
and FutureFillModel covers the shared base helper from the future path.
* Generalize stale market-order fill wait to any time of day
Replace the market-open-specific wait with a generic check: a market order
that would be filled on stale data waits for fresh data when the latest
available data is more than one subscribed resolution bar behind the current
time. This no longer considers the market open explicitly; it covers the
opening bar (the first session bar has not been emitted yet) and any intraday
data gap larger than the resolution.
ShouldWaitForFreshDataOnStale now takes the latest data end time and the
current time instead of the order time, and is shared by FillModel,
FutureFillModel and EquityFillModel. Coarse resolutions (hour/daily) still
always wait; tick never waits. Internal configurations are included when
sizing the resolution bar. EquityFillModel's best-effort price helpers now
report the stale data end time so the gap can be measured.
Tests: EquityFillModelTests and FutureFillModelTests cover the market-open and
mid-session stale cases (wait then fill on fresh data) plus the within-one-bar
boundary (fill on stale). The regression algorithm is generalized to assert no
fill happens on data staler than the resolution, with orders at the open and
mid-session. Pre-existing plumbing/data-selection tests that used degenerate
timestamps were given fresh timestamps so they still exercise their original
intent.
* Add sample data and adjust regression algorithms for stale-fill wait
Add minute/daily sample data so market orders that now wait for fresh data
can fill (ES futures gap days, TWX/GOOG equities and options, SPXW weeklies,
GC futures/options copy for 2020-01-06). Adjust a few regression algorithms
to the deferred-fill behavior: cap orders in the extended-market continuous
future test, ignore daily-resolution SPY in the automatic-seed data checks,
and refresh OptionAssignmentStatistics expected constants.
* Update regression expected statistics for stale-fill wait
Regenerate ExpectedStatistics, DataPoints and AlgorithmHistoryDataPoints for
the regression algorithms affected by the wait-for-fresh-data fill change and
the added sample data: futures/options fill-timing shifts, ES data-point count
increases, and GOOG 2015-12-28 outcome changes.
* Trim SPXW sample data to expiries within filter window
The two SPXW algorithms filter with Expiration(0,7), so contracts expiring
more than a week out are never subscribed. Drop those far-dated expiries from
the 2021-01-06/08 minute files (760KB->108KB and 776KB->108KB on the quote
files). Fills, DataPoints and statistics are unchanged; both regression tests
still pass.
* Trim ES minute and GOOG option sample data to order-fill minimum
The ES minute gap-day files source no order fills (daily-resolution algos fill
from es_daily); keep only the front contract used for execution and drop the
unused back-month contracts. Trim the GOOG 2015-12-28 option file (no fill
depends on it) to the morning chain window. Regenerate the back-month futures
statistics affected by the dropped back-month bars. Full CSharp regression
suite passes (722/722).
* Use SMA gap threshold in BasicTemplateContinuousFuture for C#/Python parity
At a fast/slow SMA cross the two averages can coincide to within rounding
noise, where the C# (decimal) and Python (double) comparisons disagree,
producing different orders between languages. Require a minimum gap before
acting on a cross so both languages stay in lockstep, and update the shared
expected statistics accordingly.
* Mirror order cap in Python algorithm and update future history counts
Apply the same pre-2013-11-12/3-order cap to the Python
BasicTemplateContinuousFutureWithExtendedMarket algorithm for C#/Python parity,
and update the QuantBook future-history expected counts to reflect the added ES
sample data.
* Use SMA gap threshold in BasicTemplateContinuousFutureWithExtendedMarket for C#/Python parity
This algorithm had the same fast/slow SMA cross divergence already fixed in
BasicTemplateContinuousFutureAlgorithm (ad8fc33): at the 2013-10-29 cross the two
averages coincide to within rounding noise (C# decimal diff -1e-25, Python double
diff exactly 0.0), so the raw `_fast > _slow` / `_fast < _slow` comparisons disagree
between languages. C# fired a liquidate+rebuild that Python skipped, producing 5
orders in C# vs 3 in Python. Require a minimum 0.001 gap before acting on a cross so
both languages stay in lockstep, and regenerate the shared expected statistics
(Total Orders 5 -> 3).
* Document SMA cross threshold as a C#/Python parity workaround
Add a short note before the fast/slow SMA comparisons in both continuous-future
template algorithms clarifying that the minimum-gap threshold exists only so the
C# and Python versions take the exact same trades on the limited sample data in
the repository, where decimal vs double rounding can disagree at a cross.
* Fetch subscription configs once per equity market fill
MarketFill resolved the subscription configs twice per fill: once via the
best-effort price helpers (GetSubscribedTypes) and again via
ShouldWaitForFreshDataOnStale. Fetch them once and thread them through both
paths via optional parameters, leaving existing callers unchanged.
* Measure stale-fill wait against order submission time
ShouldWaitForFreshDataOnStale compared the latest data end time against the
security current time. Compare against the order submission time instead so the
decision to wait for fresh data reflects how stale the data is relative to when
the order was placed. Realign the stale-price warning fill test accordingly.
* Fix stale market data in SendingNewOrderFromOnOrderEvent test
The market price tick was timestamped a day before the order submission time,
so under the order-time staleness check the market orders waited for fresh data
instead of filling. Use a reference time with the tick one minute before the
order so the data is fresh and the orders fill.
* Centralize internal-inclusive subscription config lookup in fill models
ShouldWaitForFreshDataOnStale re-resolved the subscription configs through
the ShouldWaitForFreshData call it makes first, and GetMarketFillPrice did
the same. Thread the already-fetched configs through ShouldWaitForFreshData
and GetMarketFillPrice so each market fill resolves them at most once.
Add a GetSubscriptionDataConfigs(Security) helper on the base FillModel that
returns the internal-inclusive configs, and route every fill-model call site
through it to remove the duplicated lookup and repeated comment.
* Avoid list allocation in ShouldWaitForFreshData
Replace the Where(...).ToList() + All(...) with a single foreach over the
subscription configs, short-circuiting on the first non-coarse resolution.
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Add VIX Mini Futures (VXM) support
Adds complete LEAN support for VIX Mini Futures (VXM) traded on CBOE:
- Add Futures.Indices.VIXMini = "VXM" constant
- Add expiry function: 30 days before third Friday of following month
- Add symbol properties: multiplier 100, tick 0.01 (USD)
- Add 15 test date pairs for 2023-2025 to FuturesExpiryFunctionsTestData.xml
- Add [TestCase(VIXMini, EightOClockChicagoTime)] to IndicesExpiryDateFunction test
- Add market hours configuration mirroring VX trading hours
ClosesQuantConnect/Lean#6655
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* Fix VXM expiry holiday validation and add margin file
- Replace single `if` holiday check with `while` loop using
`IsCommonBusinessDay()` to ensure the computed expiry date
is always a valid tradable day (not just one step back)
- Fix test data: 2025-03-19 -> 2025-03-18 (April 18 2025 is
Good Friday, a CFE holiday, shifting the expiry back)
- Add Data/future/cfe/margins/VXM.csv margin file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
GF's minimum_price_variation in the symbol-properties database was
0.025 (cents per pound), inconsistent with every other livestock entry
which uses dollars per pound. CME's official spec is $0.00025/lb
($12.50/tick on 50,000 lb), matching LE and HE.
With price_magnifier=100 the prior value produced an effective per-
contract tick value of $1,250 instead of $12.50, putting algorithm-
rounded prices on a grid 100x coarser than the exchange grid and
causing rejected/unreachable orders on GF.
https://www.cmegroup.com/markets/agriculture/livestock/feeder-cattle.contractSpecs.html
* rebase Add 2026 EUREX, CFE and ICE Holidays
* Remove entries present in generic entry
For some ICE Future entries, there were holidays that were already
present in their generic entry (Future-ice-[*]), so those dates were
removed from the entry
* Add 2026 HKFE Future holidays & early closes
* rebase Add 2026 Future-cme-equity Holidays, Early closes, late opens
* Add (again) HKFE 2026 Holidays and early closes
* Add Future-cme-interest 2026 holidays
* Add 2026 CME Fx 2026 holidays"
- Add 2026 CME Fx holidays, early closes, late opens, bank holidays
- Exclude CNH, MNH and MIR as they expire rules don't consider US
Holidays
- Fix wrong early close on 12/24/2025 from 12:15 to 12:45
* Add CME Future crypto 2026 Holidays, EC, LO & BH
* Add CME Future Energy 2026 holidays, EC, LO, BH
* Add CME Futures metals holidays, ec, lo, bh
* Add CME Futures grains 2026 holidays, ec, lo, bh
* Add CME Futures Dairy 2026 holidays, ec, lo, bh
* Add CME Futures livestock holidays, ec, lo, bh
* Add CME Future Lumber holidays, ec, lo, bh
* Add CME Futures Softs holidays, ec, lo, bh
* Add CME Futures Oilseeds holidays, ec, lo, bh
* Add CME Futures AW, GD Holidays, EC, LO and BH
* Move repeated bank holidays to generic entries
* Nit change
* Solve bug
Since 11/26/2026 is a bank holiday for CME energy futures, the expiry
date is moved to 11/25/2026 as the expiry date for HH is the third last
business day of the month prior to the contract month
* add dYdX market constant
* Add dYdX market constant and update symbol properties database
* get Gaz limit from order properties or default value
* wip
* add symbol properties
* add more dydx order props
* update symbol properties
* Add dYdX brokerage and fee model
* Update dYdX configuration fields
* undone meta files
* minor tweaks
* fix file ending
* Add dYdX brokerage support to BrokerageName and IBrokerageModel
* Refine dYdX fee model integration and update configuration defaults
* Replace custom order size validation in dYdXBrokerageModel with DefaultBrokerageModel implementation
* undone changes
* Add market hours for dYdX CryptoFuture
Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Use Futures Bank Holidays For Expirations
* Minor improvements
- Futures will be stored by their contract month, not expiry
* Delete dairy future products
* Minor test fixes
Python Virtual Environments / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Use correct sids when reading options/futures universe files
* Introduce new format for options and futures universe files
* Minor change
* Minor data fix
* Minor change
* Fix failing unit tests
* Add options and futures symbols cache
* [HACK] Force use test universe files
* Minor fix for universe symbols cache
* Performance improvements
* Miror change
* Cleanup
* Sort universe files
* Minor regression algorithm fix
AddAndRemoveOptionContractRegressionAlgorithm to not depend on universe file entries ordering
* Update SPDB with Bybit
* Update SPDB with CoinBase
* Update SPDB with Bitfinex
* Update SPDB with Kraken
* Update SPDB with Binance
* Update SPDB with BinanceUS
* Update regression algorithms
* Update SPDB - Binanceus to solve issues with the unit tests
* Initial solution
* Create testCases for earlyClose and lateOpen
* Refactor GetExchangeHours and add unit tests
* Update market-hours-database and create a unit test
* Resolve review comments
* Update market-hours-database
* Parallelize the foreach loop to improve test performance
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Make FOPs selection universe file-based for backtesting
* Make FOPs option chains universe file based
* Make Future universe selection file-based like option universe
* Make Future universe selection file-based like option universe
* Abstraction cleanup
* Add FuturesChains API to QC algorithm
Also refactor future chain provider to use the new FutureUniverse instead of zip file names
* Update regression algorithms stats
* Refactor QuantBook option and future history to use new universes
* Fix failing tests
* Fix failing tests
* Fix failing tests
* Minor future chains unit test improvement
* Add futures chains DataFrame property
Also, remove IDerivativeSecurity interface from Future
* Add DataFrame property to FuturesChains class
* Add regression algorithms
* Add regression algorithms
* Replace QCAlgorithm.FutureChainProvider usages with new FuturesChain api
* Minor fixes
* Reduce number of universe files in repo
* Minor data fixes
* Regression algorithms updates
* Add implicit conversion from FuturesContract to Symbol
Modified algorithms to use futures contract objects directly instead of accessing their Symbol property.
Removed unnecessary import statements and redundant lines in various files.
* Improve resolution handling for history requests
* Changed _auxiliaryData field to lazily-initialized AuxiliaryData property
* Refactor data handling in BaseChain and TimeSliceFactory
- Added `AddData` method to `BaseChain` for adding market data
- Refactored `TimeSliceFactory` to use `BaseChain.AddData` method
* Remove specific constructors and indexers from Chain classes
Removed public indexers in `BaseChains` for getting or setting `BaseChain` instances by `ticker` or `Symbol`, which were used for Pythonnet compatibility.
* Remove chain cache logic from FuturesChainUniverse
* Refactor class and interface names for clarity
Renamed `FileBasedUniverse` to `BaseChainUniverseData` and
`IFileBasedUniverse` to `IChainUniverseData`.
* Add base class for options and futures contracts
- Introduced `BaseContract` as an abstract base class for contracts, consolidating common properties and methods.
- Removed ISymbolInterface
* Add minor fix for future options tickers parsing
Added tests
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Clean chain provider classes up
* Remove ZipEntryName other classes and unused code
Removed ZipEntryName class and references across various files.
Removed DataQueueFuturesChainUniverseDataCollectionEnumerator and DataQueueOptionChainUniverseDataCollectionEnumerator classes.
Removed OptionChainUniverseSubscriptionEnumeratorFactory class.
Removed unused code for handling OptionChainUniverse and FuturesChainUniverse in FileSystemDataFeed.cs and LiveTradingDataFeed.cs.
Removed several test files related to enumerator factories and universe data collection.
* Minor changes and cleanup
* Trigger Build
* Trigger Build
* Refactor FuturesContract data handling
Forward price data from bars and ticks stored in private fields for improved memory usage
* Fix: use universe data for market data in FuturesContract
* Update regression algorithms stats after rebase
Added HSI futures universe files
* Sort configs by internal flag
Internals go first
* Throw from option universe data filters for future options
Future options IV, Open interest and greeks are not supported for future options
* Minor changes
* Improve some regression algorithms
* Minor fix for failing unit tests
* Update FOPs universe file header
Removed greeks and IV columns.
Updated FOPs universe files: removed outdated columns.
* Minor unit test fix
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Minor fix
* Add history provider as constructor argument for chain providers
* Update new regression algorithms data points count
* Minor fix for FakeDataQueue
* Add initialize method to chain providers classes
* Minor changes
* Trigger Build
* Trigger Build
* Trigger Build
* Minor fix
* Minor fix
* Trigger Build
* Trigger Build
* Trigger Build
* Trigger Build
* Add logs to ProcessedDataProvider
* Removed test logs
* Minor fix
* Support downloading options and futures universe files from api data provider
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Add new indexes, including market hours - part 4
* Resolve review comments
* Add an entry to SPDB for ASX
* Add new indexes and update the old ones
* Add entries to SPDB