17954
13277 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
11ba019f6a |
fix: keep the log handler set by the brokerage test project (#9640)
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
- stop replacing it with NUnitLogHandler on every test - brokerage test projects keep their file log for the whole run17952 17954 17955 17956 17957 17959 17953 |
||
|
|
80550da153 | Extend SecurityPriceZeroOrderResponseErrorAnalysis solution to mention guards (#9641) | ||
|
|
cd52034ddf |
Skip object store folder creation when no storage access (#9634)
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Build & Test Lean / 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
LocalObjectStore.Initialize created the storage root directory unconditionally, before Controls were even assigned. On environments where the process lacks permission to the target path this threw an UnauthorizedAccessException even for jobs with no storage access at all. Now Controls are assigned first and the root directory is only created when StorageAccess is null or grants at least one of read/write/delete, matching the permission checks already guarding every disk operation. When access is fully denied the path is still normalized via Path.GetFullPath so later comparisons remain consistent. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>17938 17941 17942 17946 17947 17948 17949 17950 17944 |
||
|
|
0136529cd8 |
Add IndexOption support to TerminalLinkBrokerageModel (#9633)
Report Generator Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Syntax 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
Matches Lean.Brokerages.TerminalLink#131, which maps IndexOption contracts to the Bloomberg Index yellow key for EMSX order routing. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17935 17936 17937 |
||
|
|
153d0b7427 |
Support Count and Python len() on user-facing lazy enumerables (#9631)
Syntax Tests / 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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Memoize order and order ticket enumerables in SecurityTransactionManager Wrap the enumerables returned by GetOrders, GetOrderTickets and GetOpenOrderTickets in MemoizingEnumerable so they expose a Count property, which also enables len() on them in Python algorithms. * Memoize lazy enumerables in other user-facing APIs Wrap SubscriptionManager.Subscriptions, SecurityCache.GetAll, Cash.SecuritySymbols and ICurrencyConversion.ConversionRateSecurities in MemoizingEnumerable so they expose a Count property, which also enables len() on them in Python algorithms. * Add Count property to IObjectStore Exposes the count of stored objects without loading their content, which also enables len() on the object store in Python algorithms. * Revert "Add Count property to IObjectStore" This reverts commit 84c0a08c7c30f14a6986a7e11dc89ea426606d1e. * Avoid memoization overhead on engine hot paths - Revert SecurityCache.GetAll memoization: fill models enumerate it once per open order on every fill scan, so memoizing only adds allocations and per-item locking on a hot path. - SecurityTransactionManager.GetOpenOrdersRemainingQuantity and CancelOpenOrders go directly to the order processor since they enumerate a single time, keeping memoization only for the enumerables returned to the user. * Centralize order ticket memoization decision in private helpers Replace direct _orderProcessor calls with private GetOrderTickets/ GetOpenOrderTickets overloads taking a required memoize flag, so every internal call site states whether the enumerable is single-pass (engine paths) or user-facing (memoized). Also drop the redundant x => true fallback: IOrderProvider documents null as match-all and every implementation handles it. * Coalesce null order ticket filters before reaching the order processor Preserves the previous behavior where IOrderProcessor implementations never received a null filter from the transaction manager.17933 |
||
|
|
f9104801d9 |
Fix runtime error when an option universe is removed and re-added in the same time step (#9626)
* Fix universe subscription exception when option universe is removed and re-added in the same time step * Remove incorrect issue reference from comments * Use RegressionTestException in regression algorithm * Clean up stale universe members when universe is removed and re-added in the same time step * Convert regression algorithms to C# and centralize universe selection data handling * Simplify fix by parking colliding universe subscription requests and re-issuing them on removal * Restore universe subscription request invariant exception * Report parked universe subscription requests as successfully added |
||
|
|
f34dbc9bdc |
Fix RelativeDailyVolume fallback denominator for intra-day gaps (#9630)
The fallback loop that runs when the current time-of-day has no exact historical slot was missing a break, so it kept overwriting the denominator with later slots and ended on the last slot of the day instead of the greatest slot <= the current time. This gave a far too small ratio for securities with intra-day data gaps. Add the break and a regression test covering the gap scenario. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
4249165f99 |
Fix trade statistics for option assignment underlying fills (#9627)
* Fix option assignment trade statistics Resolve the security from each order event when updating TradeBuilder so physically settled underlying fills use the underlying multiplier and conversion rate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 716a0df4-0117-458b-b4ac-7d8aeeb9bf48 * Resolve order event security from the event symbol Option exercises emit the underlying fill under the option's order id, so resolving the security from the order symbol handed the option's contract multiplier and quote currency conversion rate to the underlying fill, inflating closed trade statistics. Extend the option assignment regression algorithm, in both C# and Python, to assert every closed trade's profit and loss against its own security's contract multiplier. --------- Co-authored-by: Kapil Yadav <kapyadav@microsoft.com> Co-authored-by: Jhonathan Abreu <jdabreu25@gmail.com> |
||
|
|
0269115d3c |
Force live results store once holdings changes settle (#9624)
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
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
* Force live results store once holdings changes settle Monitor the securities holdings quantity changes in the live trading result handler and force a store of the full results once the changes have settled for a configurable period (holdings-changed-store-delay, defaults to 10 seconds), so stored results reflect fills quickly instead of waiting for the next scheduled store. * Encapsulate holdings change monitoring in a private nested class * Monitor order events instead of holdings quantity changes The holdings change monitor now subscribes to the transaction handler's NewOrderEvent and tracks fills, instead of wiring into every security holding QuantityChanged event, which required monitoring the securities collection changes as well. * Revert local test changes to Launcher config * Remove snapshot step from holdings change monitor * Stamp holdings changes with the order event time17932 |
||
|
|
1fee999e4f |
Update QuantConnect.pythonnet to 2.0.64 (#9623)
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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
|
||
|
|
d8b6373e50 |
Update QuantConnect.pythonnet to 2.0.63 (#9614)
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Update QuantConnect.pythonnet to 2.0.62 * Update QuantConnect.pythonnet to 2.0.6317923 |
||
|
|
2269b731aa |
feature: fix order properties with custom tags support (#9619)
* feature: fix order properties with custom tags support - new FixOrderProperties with AdditionalProperties dictionary for custom fix tags - clone copies the additional properties dictionary - new BloombergFixOrderProperties inherits it - moved HandleInstruction, Notes and handling constants from FixOrderProperites - misspelled FixOrderProperites is obsolete and now inherits FixOrderProperties * feat: add support MOC to BGG fix * fix: clean up after FixOrderProperites deprecation - TradingTechnologiesOrderProperties inherits FixOrderProperties directly - remove stale MarketOnClose test case from BloombergFixBrokerageModelTests |
||
|
|
5767a8f870 |
Remove KRX futures opening call auction from tradable hours (#9620)
The 08:30-08:45 KRX derivatives pre-open call auction was modeled as a premarket segment for Future-krx-[*] and Future-krx-KM. In Lean, premarket segments are tradable when extended market hours are enabled, but the opening auction is order-collection only: no continuous trades occur and all matching happens in a single cross at 08:45. Modeling it as premarket overstated tradability. Removing the block makes the earliest fill the 08:45 opening cross, matching the KRX regular-session start (08:45-15:45). The night session (18:00-06:00) is genuine continuous trading and is kept. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
3a39c58f21 |
Add KOSPI 200 Index (KM) Futures (#9585)
* Add KOSPI 200 Index (KM) Futures support Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix Forex-interactivebrokers formatting and add KRX futures holidays Expand the compact single-line session arrays in Forex-interactivebrokers-[*] to the multi-line style used throughout the market-hours database. Add South Korean (KRX) market-closure holidays (2000-2027) to Future-krx-[*] and Future-krx-KM, including lunar holidays (Seollal, Buddha's Birthday, Chuseok), substitute holidays, election-day closures, year-end closures, and the reinstated Constitution Day (7/17/2026 onward). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Add USD/KRW forex entry for Interactive Brokers Enables USD/KRW live trading/pricing through the Interactive Brokers brokerage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Fix KM futures expiry and market hours, add KM index support - Roll non-quarterly contract months forward to the HMUZ cycle in the Kospi200 expiry function, with regression tests covering the cycle normalization and holiday walk-backs (2002 election day, Chuseok 2003 double walk-back, Chuseok 2019) - Remove holidays duplicated in Future-krx-KM: they are inherited from Future-krx-[*] at load time (MarketHoursDatabaseJsonConverter unions specific entries with the market wildcard) - Add missing KRX closures: Constitution Day 2000-2007 (holiday until abolished in 2008), 7/1/2002 World Cup temporary holiday and 1/3/2000 Y2K closure - Fix KRX derivatives sessions per exchange specs: regular session 08:45-15:45 (pre-open auction 08:30-08:45) and night session 18:00-06:00 as extended hours - Add late opens (09:45) for the first trading day of each year and CSAT exam days 2000-2027, which delay the exchange open by one hour - Add Index-krx market hours entries (09:00-15:30, 10:00 late opens) and map the KM index ticker to Market.KRX in IndexSymbol Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Martin Molinero <martin.molinero1@gmail.com> |
||
|
|
3359ca9bc1 |
feature: register bloomberg fix brokerage in lean core (#9618)
Report Generator Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Regression Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
- add BloombergFix to BrokerageName and brokerage model factory - add live-bloomberg-fix environment and config keys - add BloombergFixBrokerageModelTests17921 |
||
|
|
b807256bde |
docs: readme says dotnet 9, but the projects target net10.0 (#9617)
All 23 .csproj files declare <TargetFramework>net10.0</TargetFramework> and the Dockerfile installs dotnet-sdk-10.0, so the setup steps should ask for dotnet 10, not 9. |
||
|
|
c95a3fd5df |
Fix order deserialization overflow for values at the edge of the decimal range (#9615)
Syntax 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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Order quantities and prices out of the decimal range are clamped to decimal.MaxValue/MinValue at order creation, e.g. by the QCAlgorithm double quantity order methods through SafeDecimalCast. When read back, JObject parses these values as doubles that round past the decimal range, so Value<decimal>() threw an OverflowException. Clamp them back into range when deserializing. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17919 17920 |
||
|
|
c22774e49e |
Fix margin call handling for single-lot option strategy position groups (#9612)
Syntax Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
A margin call requiring a partial reduction of an option strategy position group probes a zero-quantity trial group while solving for the order quantity. The option strategy margin helpers assume at least one leg with non-zero quantity and threw InvalidOperationException, crashing the algorithm. Return zero initial/maintenance margin for zero-quantity groups so the margin call converges on full liquidation.17918 17917 |
||
|
|
90ea185345 |
Fix ApiConnection authorization header thread safety (#9610)
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Fix ApiConnection authorization header thread safety SetAuthenticator(HttpRequestMessage) was writing the Authorization header to the shared HttpClient.DefaultRequestHeaders on every request. HttpHeaders is not thread safe: under concurrent requests one thread mutates the collection while another enumerates it during request serialization, causing NullReferenceException failures, and requests could also be serialized with a mismatched Authorization/Timestamp pair causing intermittent authentication failures. Set the Authorization header on the request message itself instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Include stack trace when logging unexpected api request exceptions Network failures are already described by their HttpRequestError and SocketErrorCode details and are frequent during outages, so they stay on a single line. Any other exception type is unexpected, include its stack trace so the source can be located directly from the logs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Harden ApiConnection.TryRequestAsync request path Guard against a null RequestUri, which is valid when the client has a BaseAddress set, and handle response deserialization failures with the http status code and raw response content instead of surfacing a parse exception, for example an html error page returned by a proxy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17916 |
||
|
|
c283231d11 |
Improve error messages for unsupported Python objects in user-facing APIs (#9607)
Syntax Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Improve error message when consolidator period Python object is unsupported * Make unsupported consolidator period error message more concise * Apply descriptive Python conversion errors to other user-facing sites and add QuoteBarConsolidator.FromResolution * List available overloads in unsupported Python argument error messages * Update QuantConnect.pythonnet to 2.0.61 * Update overload hint test expectations to Python-typed signatures * Exclude PyObject overloads from error hints and update to Python annotation style * Move PyObject overload filtering from consumers into MethodSignatureFormatter * Update Python alpha model name expectations for Python-style enum rendering17915 |
||
|
|
046fb456f8 |
Allow option filter functions to return None/null (#9608)
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
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
* Allow Python option filter functions to return None The option filter universe is modified in place by the filter methods (strikes, expiration, etc.), whose return value is only necessary for chaining. A Python filter function that returns None would kill the algorithm with a NullReferenceException. * Allow C# option filter functions to return null and add regression algorithms Adds C#/Python regression algorithms asserting that option filter functions are allowed to mutate the universe in place and return null/None instead of the universe, which is only necessary for chaining.17914 |
||
|
|
73ae785a6f |
Add Count property to derivative security filter universes (#9605)
Exposes the number of contracts in IDerivativeSecurityFilterUniverse implementations. This also enables len() on OptionFilterUniverse and FutureFilterUniverse instances in Python algorithms, which previously raised TypeError: object of type 'OptionFilterUniverse' has no len() |
||
|
|
8772f3b50f |
Improve ApiConnection request error logging and connection handling (#9604)
Syntax Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Regression Tests / 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
Python Virtual Environments / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Request failures now log whether the configured timeout elapsed vs an external cancellation, the elapsed time, the full exception cause chain with HttpRequestError/SocketErrorCode details and the thread pool state, instead of only the top level exception message. The HttpClient is now built with a SocketsHttpHandler using a connect timeout, so connection establishment failures surface quickly instead of consuming the whole request timeout, and a pooled connection lifetime so DNS/load balancer changes and stale NAT state are picked up. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17912 17913 |
||
|
|
b9f616b454 |
Set security cache open interest from chain universe data (#9601)
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Set security cache open interest from chain universe data - The option and future security caches now update the open interest cache property from stored chain universe data points (OptionUniverse, FutureUniverse), which the algorithm manager pushes into the security caches - Add index option and future option specific security caches, mapped in the SecurityCacheProvider, which previously fell through to the base SecurityCache - Add regression algorithms asserting the behavior for equity options, index options and futures Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Guard against empty data lists when updating open interest StoreData is public API, add an UpdateOpenInterest overload taking the data list which checks the count before accessing the last data point Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17910 |
||
|
|
4e7d7b3221 |
Update QuantConnect.pythonnet to 2.0.60 (#9600)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
e709e62b80 |
Update QuantConnect.pythonnet to 2.0.59 (#9595)
Report Generator Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Research Regression Tests / 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
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>17905 17902 17907 17908 17909 17903 |
||
|
|
0868fbdd94 |
Consolidator rolling window fixes (#9596)
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
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
* Fix consolidator rolling window event ordering and out of order handling * Unify DataConsolidated event and expose rolling window to Python consolidators * Minor fixes --------- Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>17901 |
||
|
|
e3724a4c6d |
Add built-in rolling window to all consolidators (#9366)
* Add built-in rolling window to all consolidators * Minor fix * Add unit tests * Add Current and Previous properties to consolidators * Add WindowBase<T> as single source of truth for rolling window logic * Address review comments on consolidator rolling window * Fix duplicate window in consolidator wrappers * Fix Python consolidator equality * Address review comments * Make ConsolidatorBase implements IDataConsolidator * Add IDataConsolidator<T> generic interface to avoid casting Consolidated output * Revert "Add IDataConsolidator<T> generic interface to avoid casting Consolidated output" This reverts commit f4bf812f4b26aff2789a8129fb07101962557a2a. * Address second review round on consolidator rolling window * Populate consolidator window before firing DataConsolidated events * Move WindowBase to the Indicators namespace * Restore original consolidator event ordering * Recover original Sequential wire-up comment |
||
|
|
cf6ad512cb |
Keep pythonnet overloads hint in NoMethodMatchPythonExceptionInterpreter message (#9594)
The interpreter replaced the original pythonnet binding-failure message
with a friendly one built from the parsed method name, discarding the
candidate-signatures hint pythonnet 2.0.57+ appends ("The expected
signature is:" / "The following overloads are available:" followed by
the signatures). That hint is what lets users see which parameter
didn't match, so extract it from the original message and append it to
the interpreted one.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
||
|
|
26eabb3a6e |
Fix GetPreviousMarketOpen: 7-day search limit insufficient (#9593)
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
- Increase loop iteration count from 7 to 9 Closes https://github.com/QuantConnect/Lean/issues/959217900 |
||
|
|
047600be8a | Update QuantConnect.pythonnet to 2.0.58 (#9591) | ||
|
|
c88955b91a |
Update QuantConnect.pythonnet to 2.0.57 (#9584)
Syntax Tests / 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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Update QuantConnect.pythonnet to 2.0.57 * Update NoMethodMatch interpreter tests for pythonnet 2.0.57 snake_case method names pythonnet 2.0.57 renders the method name in the 'No method matches given arguments' TypeError in snake_case (e.g. 'for set_cash:' / 'for rsi:'), matching the name Python callers use. The interpreter extracts it correctly; only the tests' hardcoded PascalCase expectations (SetCash, RSI) were stale. Assert the snake_case names the API now emits.17899 |
||
|
|
33ff836857 |
Compute probabilistic Sharpe ratio on excess returns (#9583)
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Use risk-free rate in probabilistic Sharpe ratio * Extend risk free rate to live report PSR and fix probabilistic sharpe ratio tests * Update regression statistics * Update test regression statistics * Add test asserting Sharpe ratio and PSR consistency * Use excess returns for live report Sharpe and PSR --------- Co-authored-by: Kevin-Li-2025 <2242139@qq.com>17898 |
||
|
|
d26ec37cd5 |
Liquidate ignores unknown symbols (#9590)
* Ignore not-added symbols in Liquidate instead of throwing * minor fix |
||
|
|
9b0d893a74 |
Handle AddIndexOption passing target option (#9589)
Syntax Tests / build (push) Has been cancelled
Report Generator Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
|
||
|
|
52a55b504e |
Dynamic transaction thread pool (#9536)
Syntax Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Regression Tests / 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
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Add dynamic transaction thread pool that grows on demand * Simplify dynamic worker pool * Move dynamic thread pool into transaction handler * Grow transaction threads on demand with order pinning * Extract order request processing into a dedicated pool * Move request routing and release into the processing pool * Address review comments * Simplify processing pool shutdown and queue lookup * Fix combo re-routing when a simple order shares its group id * Process order requests off a single shared worker queue * Address review comments * Log when the transaction pool grows a new thread * Add test for processing many orders quickly * Fix synchronous processing snapshot * Address review comments * Shutdown drain fix. TryExpand start thread without lock. Restore FIFO for non-concurrent live brokerages --------- Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>17896 |
||
|
|
a4bea040d3 |
Auto-subscribe symbols when registering indicators and consolidators (#9582)
Syntax Tests / 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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Registering an indicator or consolidator for a symbol that had not been subscribed to threw 'Please register to receive data for symbol ...'. Order submission already auto-subscribes the symbol on the user's behalf; this applies the same behavior to indicator/consolidator registration. GetSubscription now adds the security automatically when it has no subscription (guarded by the shared CanAutoAddSecurity check, which is also used by order submission) before falling back to the error. The subscription lookup is exposed via a TryGetSubscription out-parameter helper.17894 17895 |
||
|
|
77caa034e3 |
Add Python version of IndicatorVolatilityModelAlgorithm (#9580)
Port the C# regression algorithm demonstrating IndicatorVolatilityModel usage, including how to reset and warm up the indicator on splits and dividends to avoid volatility jumps from price discontinuities, and enable the Python variant in the regression test suite. Closes #6375 Claude-Session: https://claude.ai/code/session_01R7LGdW3eC9za8WMrtssHGr Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
d0a0ab8935 |
Update QuantConnect.pythonnet to 2.0.56 (#9581)
Report Generator Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
|
||
|
|
02948bf75f |
Add observed Juneteenth 2027 (6/18/2027) to futures market hours (#9572)
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> |
||
|
|
1479a1e836 |
Add Price, Value and Close aliases to BaseContract (#9578)
* Add Price, Value and Close aliases to BaseContract Expose Price, Value and Close on BaseContract as aliases of LastPrice to mimic the BaseData/TradeBar API without inheriting BaseData. Marked with PandasIgnore to avoid duplicating the LastPrice column in chain DataFrames. * Keep BaseContract chains DataFrame unchanged for Value alias The pandas converter force-includes the 'Value' member for non-Lean-data types (to preserve the value column of custom data types despite BaseData.Value being PandasIgnore'd). That override made the new BaseContract.Value alias leak into option/future chain DataFrames as a redundant 'value' column. Exclude BaseContract-derived types from the forced inclusion so their PandasIgnore'd aliases are honored and the chain DataFrames stay unchanged. * Isolate OptionContract alias test from shared price-model singleton OptionContract's default option data is the shared static OptionPriceModelResultData.Null singleton, which other tests mutate via Update. Reading LastPrice before setting up the contract's own data made the assertion depend on global test state (failing in CI with a leaked price). Assign a dedicated price model so the contract no longer reads from or writes to the shared singleton. * Give each OptionContract its own default option data instead of a shared singleton OptionContract initialized its option data to the shared static OptionPriceModelResultData.Null singleton. Update() mutates that data, so contracts without an explicit price model shared and clobbered each other's trade/quote/open-interest state (a latent bug, and the cause of order-dependent test failures). Each contract now gets its own default OptionPriceModelResultData instance, and the alias test no longer needs to work around the shared state. * Restore shared Null option data default and reset it in test SetUp Revert OptionContract back to the shared static OptionPriceModelResultData.Null default. To keep the alias test deterministic, reset that singleton in the fixture's SetUp by updating a throwaway contract with a zero-priced trade bar, and give the tested contract its own price model so its Update doesn't re-pollute the singleton. |
||
|
|
d04e46784c |
Revert "Update QuantConnect.pythonnet to 2.0.55 (#9577)" (#9579)
Benchmarks / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
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
This reverts commit
17886
|
||
|
|
e5a3ab476d |
Update QuantConnect.pythonnet to 2.0.55 (#9577)
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / 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
Research Regression Tests / build (push) Has been cancelled
|
||
|
|
eb12c8fa65 |
Seed runtime-added currency conversion rates immediately (#9568)
* Seed runtime-added currency conversion rates immediately Fixes the spurious 'The conversion rate for <currency> is not available' runtime error caused by a two-path seeding asymmetry. The setup path (BaseSetupHandler.SetupCurrencyConversions) wires up a currency's conversion feed AND seeds its rate via history/last-known-price so the rate is non-zero right away. The runtime path (UniverseSelection.EnsureCurrencyDataFeeds, invoked during universe selection / SetCash mid-run) only created the conversion subscription and left the rate at 0 until the first bar of the pair arrived. Any conversion in that gap (classically a midnight scheduled SetHoldings firing before the day's first conversion-pair bar) threw. EnsureCurrencyDataFeeds now seeds newly introduced, still-zero-rate conversion securities and calls cash.Update(), mirroring the setup path. Seeding is gated behind a seedNewCurrencies flag (default true) so the setup caller, which performs its own optionally white-listed seeding, can opt out and not regress white-list semantics. SeedSecurities degrades gracefully when no history/data is available, leaving the rate at 0 as before, so live mode and no-history scenarios are safe. Adds a regression test exercising the runtime path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Make runtime currency seeding robust and fix regression expectation CI failures from the runtime currency-conversion seeding change: 1. AlgorithmWarmupTests.WarmUpInternalSubscriptions threw ArgumentNullException because the new EnsureCurrencyDataFeeds seeding path ran GetLastKnownPrices in a stub where the conversion security lacked SymbolProperties. Pre-seeding is best-effort and must never break the algorithm, so wrap it in try/catch and degrade gracefully (leave the rate at 0, the pre-fix behavior) - matching the documented intent. The first conversion-pair bar still updates the rate. 2. ScheduledUniverseSelectionModelRegressionAlgorithm (C# + Python) asserted AlgorithmHistoryDataPoints == 0. The algorithm runtime-adds Forex pairs (EURGBP -> GBP cash) via scheduled universe selection; the fix now correctly seeds that runtime currency's conversion rate with a last-known-price history request (deterministically 50 points). The old 0 reflected the buggy unseeded behavior, so update the expectation to 50. No other statistics changed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Seed runtime added currency conversion rates * Seed currencies with no new conversion feed and dedup the seeding helper --------- Co-authored-by: Martin-Molinero <Martin-Molinero@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
202a63ea44 |
Add Empty property to MemoizingEnumerable (#9576)
Adds a boolean Empty property that reports whether the enumerable yields any items, forcing enumeration of only the first item so memoization and lazy evaluation are preserved. Includes unit tests covering empty/non-empty sources, lazy single enumeration, disabled memoization, and enumerable integrity after accessing Empty. |
||
|
|
feec818951 |
Fix method name parsing in NoMethodMatchPythonExceptionInterpreter (#9573)
The interpreter extracted the method name with LastIndexOf(" "), which
returned the last space-delimited token of the pythonnet message (a
fragment of the argument type list, e.g. "'QuantConnect.Resolution'>)")
instead of the actual method name. Parse the name from between the
"for " keyword and the following ":" instead.
|
||
|
|
a565dfa6f0 |
Wait for fresh data before filling market orders on stale data (#9563)
* 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. |
||
|
|
38a78c411a |
Add arithmetic operators to numeric MultiPeriodField classes (#9571)
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
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
* Add arithmetic operators to numeric MultiPeriodField classes Implement +, -, *, / and % operators on the numeric MultiPeriodField and MultiPeriodFieldLong base classes so fundamental fields can be combined arithmetically. Operators act on each field's default-period Value and return decimal, consistent with the existing implicit decimal conversion. Includes unit tests covering field-to-field and field-to-scalar arithmetic for both base classes. * Add cross-type operators between double and long backed fields Support arithmetic between the double-backed MultiPeriodField and the long-backed MultiPeriodFieldLong by adding the mixed-type operator overloads (both orderings) for +, -, *, / and %. Includes a unit test covering double/long arithmetic in both directions.17883 17884 |
||
|
|
b5b7b64612 |
Cap flat equity curve analysis sample to five longest segments (#9569)
Report Generator Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
|
||
|
|
71cabb4141 |
Update mypy version in syntax tests workflow (#9566)
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
|