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
* Append out of memory diagnostics to the algorithm runtime error message
* Merge out of memory detection and diagnostics into a single method and shorten the message
* Only check the top level exception for out of memory diagnostics
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>
* 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
* 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>
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 time
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 rendering
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.
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>
* 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>
* Retry transient empty/failed remote custom-data downloads
A remote custom-data source can intermittently answer with a transient failure or
a successful-but-empty body (e.g. an HTTP 200 with no content from a proxied
endpoint). Previously a single such response made RemoteFileSubscriptionStreamReader
treat it as the file contents: an empty byte[] passed the 'bytes != null' check and
was written/cached as a valid (empty) file, so the whole subscription silently
yielded no data and, with caching enabled, reused the empty file.
Download with a bounded retry that treats an empty response or an exception as
transient, and only persist/cache a non-empty result. On HTTP errors a WebException
is still thrown after the retries are exhausted, preserving existing behavior.
Adds tests: retry recovers after empty responses, and an empty download is not cached.
* Update RemoteFileSubscriptionStreamReader.cs
* task: remove extraneous defaults from Isolator/MonitorTask
- ExecuteWithTimeLimit -- the only user of private MonitorTask --
already defines the defaults for memoryCap & sleepInterval
* fix: typos
* Align OnWarmupFinished time to StartDate when ScheduledUniverse skips midnight
* Align algorithm time to StartDate before OnWarmupFinished fires
* Apply warmup time alignment fix to LiveSynchronizer
* Minor fix
* Skip warmup pulse if algorithm not locked
* Fix OnWarmupFinished timing in live trading
Regression Tests / build (push) Has been cancelled
Benchmarks / 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
Python Virtual Environments / build (push) Has been cancelled
* Fix DataManager skipping invalid data type subscriptions
* Update regression algorithms
* Use effective resolution when looking up subscription data types
* Initial backtest analyzer commit
* Changes for cleanup
* Minor fix
* Add class for analysis result context
* Fix more models
* More fixes
* More fixes
* More fixes
* More fixes
* Cleanup
* Cleanup
* Add documentation
* Cleanup and remove some classes
* Write backtest analysis to results file
* Cleanup
* Minor fixes
* Minor fix
* Minor cleanup
* Implement json deserialization for backtest analysis result
* Rename analyzer classes to generalize
Remove "backtest" references from names
* Add weight to analyses
* Run analyses in order by weight
* Cleanup
* Cleanup
* Update Issue text
* Set sub-test weights to 0
* Update test weights
* Add xml docs
* Disable result analysis on regression tests
* Refactor analysis naming
* Renaming cleanup
* Simplify analysis results context
* Log when analyzer reaches max tests or time limit
* Sample down equity curve to match daily benchmark
* Minor changes
* Minor fixes
---------
Co-authored-by: Derek Melchin <melchin.derek@gmail.com>
* Use universe settings when adding derivatives
Use resolution, fill forward and extended market hours settings from universe settings when adding derivative securities (options, index options, futures and future options)
* Minor python syntax check fix
* Minor change
* Default resolution from universe settings for common lean types securities
* Minor test fix
* Cleanup
* feat: add CanonicalDataDownloaderDecorator for chain support
Introduced CanonicalDataDownloaderDecorator to enable automatic resolution and parallel downloading of all contracts for canonical symbols (options and futures chains). Updated Program.cs and DownloaderDataProvider to use this decorator, ensuring seamless data retrieval for both canonical and non-canonical symbols. Refactored initialization logic to handle chain providers within the decorator and removed redundant code from Program.cs.
* feat: improve canonical symbol error handling in data downloader
* refactor: data downloader selection in DownloaderDataProvider
* refactor: CanonicalDataDownloaderDecorator construction
* feat: limit parallelism and improve contract data error handling
* refactor: canonical data downloader and provider usage
* remove: CanonicalNotSupportedException and refactor handling
* refactor: data downloader selection with selector class
Introduce DataDownloaderSelector to choose the correct IDataDownloader implementation based on data type, using CanonicalDataDownloaderDecorator only when needed. Update Program.cs and DownloaderDataProvider to use the selector, remove redundant initialization logic, and ensure proper resource disposal. This improves flexibility, correctness, and resource management for data downloads, especially for custom and canonical data types.
* fix: wrong selector condition
* refactor: change default log handler; add parallelism config to downloader
- Set ConsoleLogHandler as the default log handler in code and config
- Make contract download parallelism configurable via downloader-thread-count (default 4)
- Track and log number of processed contracts in CanonicalDataDownloaderDecorator
- Add error logging for missing universe data
- Improve logging clarity and code readability
* feat: prevent duplicate contract downloads in canonical chains
Introduce ContractDownloadParameters to uniquely identify contract/tick type/resolution combinations and cache them in CanonicalDataDownloaderDecorator, avoiding redundant downloads when contracts are shared across canonical symbol chains. Add date range optimization for contract downloads and unit tests for the new class.
* Revert "feat: prevent duplicate contract downloads in canonical chains"
This reverts commit 44386c4c788904531c473c60c2a173e2354561ec.
* feat: clamp contract date ranges, deduplicate downloads
Added AdjustDateRangeForContract to CanonicalDataDownloaderDecorator to clamp start/end dates based on contract expiry and security type. Introduced _contractsCache to prevent duplicate downloads across canonical chains and _processedContracts for logging. Updated contract retrieval logic for deduplication. Added NUnit tests to verify date range adjustments for futures and options.
* refactor: canonical contract date range adjustment logic
* test:feat: add test for non-option/future contract date adjustment
* feat: make look-back periods for canonical symbols configurable
* refactor: remove Lazy from CanonicalDataDownloaderDecorator
Revert "refactor: remove Lazy from CanonicalDataDownloaderDecorator"
This reverts commit 909c1299406688a19352273f8d0b5b3ea99c0fb9.
refactor: Inject IMapFileProvider into downloader selectors
Revert "refactor: Inject IMapFileProvider into downloader selectors"
This reverts commit 0add95269809680e425bfa6080e465bf16377e56.
Reapply "refactor: remove Lazy from CanonicalDataDownloaderDecorator"
This reverts commit 9e3c4bed078868a3c8dfedcab0e52d6dced1daad.
* refactor: data downloader dependency injection
* refactor: provider initialization in data downloader classes
* refactor: DataDownloaderSelector dependencies, add tests
- Require explicit IDataProvider in DataDownloaderSelector constructor, removing default and fallback logic
- Change default log handler to ConsoleLogHandler in Program.cs
- Pass DownloaderDataProvider as IDataProvider to DataDownloaderSelector
- Add DataDownloaderSelector unit tests to verify correct downloader selection and decorator usage
* feat: ensure factorFileProvider is initialized when defaulted
* fix: missed dataProvider in DataDownloaderSelector ctor
* refactor: improve IFactorFileProvider resolution in DataDownloaderSelector
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / 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
* Implement indicator-based option price model
This model uses IV and Greeks indicators to implement Lean's own option pricing model
* Minor fixes
* Address peer review
* Minor tests fixes
* Make the indicator based price model the default for options
* Address peer review
* Cleanup and minor changes
* Support indicators configuration for new pricing model
* Some cleanup
* Add QL option price model example algorithm
* Return lean models from static helpers
* Minor tests fixes
* Minor test fixes
* Address peer review
* Cleanup
* Fix unit tests
* Move QL models to OptionPriceModels.QuantLib.*
* Add forward tree helper method
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
* Enhance order request processing by grouping requests and adding concurrency tests
* Minor adjustment
---------
Co-authored-by: Adrian Tkacz <adrian.tkacz@creatdy.com>
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Add a temporary benchmark stats sample in live
Allow trades to be written to result file on first day of the deployment before the first daily sample is done
* Enable trades results streaming
* Minor changes
* Make Trade.Id a Guid
* Cleanup
* Sample temporary charts once per hour
* Minor change
* Minor fix
* Minor fix
* Minor fix
* Add fix for potential race condition
* feat: add MappedSynchronizingHistoryProvider base class
Introduces an abstract class for history providers that handle symbol mapping and time-aligned data slices. Uses IMapFileProvider to resolve ticker changes, provides an abstract method for mapped history retrieval, and overrides GetHistory to synchronize results. Enables nullable reference types and adds documentation.
* Minor tweaks
---------
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
Report Generator 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
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Add total performance statistics to live result files
* Truncate closed trades in live results
* Avoid adding totalPerformance to live minute result file
* Deprecated Trade.Symbol in favor of new Trade.Symbols
* Fixes for Trade serialization
* Add trades json serialization tests
* Cleanup