2841 Commits

Author SHA1 Message Date
Jhonathan Abreu 96030d3317 Append out of memory diagnostics to the algorithm runtime error message (#9642)
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
* 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
2026-07-29 18:25:50 -04:00
Derek Melchin 80550da153 Extend SecurityPriceZeroOrderResponseErrorAnalysis solution to mention guards (#9641) 2026-07-28 17:56:55 -03:00
Martin-Molinero 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>
2026-07-23 15:59:55 -03:00
Jhonathan Abreu 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
2026-07-20 21:43:01 +00:00
YadavKapil 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>
2026-07-20 14:37:51 -04:00
Jhonathan Abreu 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 time
2026-07-17 12:44:27 -04:00
Jhonathan Abreu 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
2026-07-16 11:25:22 -04:00
Jhonathan Abreu 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.63
2026-07-15 11:10:57 -04:00
Jhonathan Abreu 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 rendering
2026-07-13 09:23:35 -04:00
Jhonathan Abreu 4e7d7b3221 Update QuantConnect.pythonnet to 2.0.60 (#9600)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 17:12:35 -03:00
Jhonathan Abreu 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>
2026-07-08 12:01:34 -04:00
Jhonathan Abreu 047600be8a Update QuantConnect.pythonnet to 2.0.58 (#9591) 2026-07-07 11:57:01 -04:00
Jhonathan Abreu 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.
2026-07-06 17:07:35 -04:00
JosueNina 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>
2026-07-06 11:22:41 -03:00
Jhonathan Abreu 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
2026-07-02 10:52:33 -04:00
Jhonathan Abreu 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 e5a3ab476d.
2026-07-01 18:55:09 -03:00
Jhonathan Abreu 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
2026-07-01 14:06:04 -04:00
JosueNina 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>
2026-07-01 12:40:54 -03:00
JosueNina 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
2026-06-29 14:13:20 -03:00
JosueNina 289605dad3 Fix zero live statistics caused by chart trimming (#9520)
* Keep daily sample of statistics charts

* Aggregate OHLC when trimming the daily sample of statistics charts
2026-06-22 15:56:12 -05:00
Martin-Molinero 5701f1c740 Make remote custom-data downloads robust to transient empty/failed responses (#9544)
* 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
2026-06-22 10:35:21 -03:00
JosueNina 83401c0f99 Prefix all algorithm logs and messages with IAlgorithm.Time (#9519) 2026-06-19 14:49:38 -03:00
JosueNina 7821b02980 Market hours aware intraday consolidation (#9530)
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
* Add market-hours aware intraday consolidation to MarketHourAwareConsolidator

* Minor fix

* Address review comments

* Assert consolidated bar size in regression algorithms

* Move MarketHourAwareConsolidator to Data.Consolidators namespace

* Remove accidentally committed log file

* Keep MarketHourAwareConsolidator in Data.Common namespace

* Move MarketHourAwareConsolidator to Data.Consolidators namespace
2026-06-17 11:09:55 -03:00
Martin-Molinero 98c59a0a32 Improve flat equity curve analysis solutions (#9529)
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
2026-06-12 15:51:52 -03:00
Martin-Molinero 90261c89ee Few minor fixes for OrderFillsDuringExtendedMarketHoursAnalysis (#9523)
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
* Few minor fixes for OrderFillsDuringExtendedMarketHoursAnalysis

* Minor cleanup
2026-06-11 11:49:56 -03:00
Jhonathan Abreu 23af4cbcd8 Add support for report log type (#9511)
* Add support for report log type

* Minor changes and improvements

* Minor fix
2026-06-08 15:12:48 -04:00
laur89 9b6203ceca task: remove extraneous defaults from Isolator/MonitorTask (#9514)
* task: remove extraneous defaults from Isolator/MonitorTask

- ExecuteWithTimeLimit -- the only user of private MonitorTask --
  already defines the defaults for memoryCap & sleepInterval

* fix: typos
2026-06-08 13:56:37 -03:00
JosueNina 9046162f77 Fix OnWarmupFinished algorithm time alignment (#9445)
* 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
2026-05-15 10:08:49 -03:00
Martin-Molinero 163de7d379 Minor backtest analysis fixes (#9479)
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
2026-05-12 12:01:52 -03:00
Jhonathan Abreu 3806e81388 Add Count property to MemoizingEnumerable (#9468)
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 Count property to MemoizingEnumerable

* Update Pythonnet version to 2.0.54
2026-05-08 16:10:58 -04:00
JosueNina 63720f4504 Fix snake_case error messages for Python algorithms (#9345)
* Fix snake_case error messages for Python algorithms

* Minor fix

* improve FormatCode robustness and fix test state isolation

* migrate QCAlgorithm inline messages to Messages classes

* Solve review comments

* Minor fix

* Fix broken regression tests

* Minor fix

* Minor fix

* Add FormatCodeRoot helper for Python self-referenced properties

* Address review comments

* Minor fix
2026-05-08 11:41:25 -03:00
Martin-Molinero afd62cda32 Minor initialization weak (#9460)
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
2026-05-06 15:57:09 -03:00
JosueNina 3f5eefd879 Fix IResultHandler.RuntimeError not stopping the algorithm (#9444)
Python Virtual Environments / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / 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
* Fix IResultHandler.RuntimeError not stopping the algorithm

* Minor fix
2026-05-04 10:46:43 -03:00
Martin-Molinero 387b56bdd6 Minor fix for schedule universe to always be 8 am ny (#9427)
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
- Avoid schedule universe running 7 or 8 NY depending on daylight
  savings, now will always run 8 am NY. Adding unit tests
2026-04-21 11:26:44 -03:00
JosueNina 7602c5bde0 Fix DataManager creating invalid data type subscriptions (#9379)
API Tests / build (push) Has been cancelled
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
2026-04-14 10:32:47 -05:00
Jhonathan Abreu 8f2a23e97f Results analyzer (#9336)
* 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>
2026-04-07 17:41:12 -04:00
Jhonathan Abreu cefa6341f4 Source option price model data from securities instead of slice (#9315)
API Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Source option price model data from securities instead of slice

* Remove symbols caching and cleanup

* Cleanup
2026-03-04 10:25:14 -04:00
Jhonathan Abreu 9573eea52e Use universe settings when adding derivatives (#9309)
* 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
2026-03-03 12:18:10 -04:00
Jhonathan Abreu 150dac5086 Update Pythonnet version to 2.0.53 (#9303)
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
* Update Pythonnet version to 2.0.53

* Minor python syntax fix
2026-02-23 11:24:04 -04:00
Roman Yavnikov d1337eae2c Feat: CanonicalDataDownloaderDecorator for chain support (#9299)
* 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
2026-02-23 15:58:15 +02:00
Jhonathan Abreu e68ee853db Implement indicator-based option price model (#9237)
API Tests / build (push) Has been cancelled
Benchmarks / 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
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
2026-02-19 15:15:25 -04:00
Adrian Tkacz c55a064fe0 Fix combo order queue affinity to prevent duplicate brokerage submissions (#9293)
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
* 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>
2026-02-16 11:44:39 -03:00
Jhonathan Abreu 5e148a06af Add orders associated with closed trades on streaming (#9282)
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
2026-02-12 12:31:56 -03:00
Jhonathan Abreu d329960e5f Enable trades results streaming (#9234)
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
2026-02-03 18:46:06 -03:00
Roman Yavnikov 297207badb feat: add MappedSynchronizingHistoryProvider base class (#9256)
* 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>
2026-01-30 16:55:10 -03:00
JosueNina 609deb2b03 Logging only once price rounding warnings (#9238) 2026-01-26 12:54:33 -03:00
Jhonathan Abreu 7fb246511a Add total performance statistics to live result files (#9224)
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
2026-01-16 15:41:35 -04:00
JosueNina 5b8e54f272 Reduce excessive debug logging in live trading (#9220)
* Reduce excessive logs

* Revert unnecesary log changes
2026-01-13 14:19:40 -03:00
Roman Yavnikov 48fd4eccff Feat: override ToString() in several Event Args (#9217)
* feat: override ToString() in several Event Args

* fix: typo
2026-01-13 10:00:48 -03:00
Martin-Molinero 10902f95dd net10 fix: Update clr-loader (#9166)
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Regression 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
Python Virtual Environments / build (push) Has been cancelled
2025-12-29 19:07:35 -03:00