1317 Commits

Author SHA1 Message Date
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 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 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.
2026-07-10 16:20:51 -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
JosueNina 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
2026-07-07 16:12:46 -05: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
jonathanwu906 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>
2026-07-02 15:00:06 -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
Jhonathan Abreu 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.
2026-07-01 11:22:50 -04:00
JosueNina 17858bada8 Make CustomDataPropertiesRegressionAlgorithm deterministic (#9559)
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
Report Generator Tests / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
* Use local data source in CustomDataPropertiesRegressionAlgorithm

* Use crypto data source instead of equity
2026-06-24 12:20:20 -05:00
Martin-Molinero 27de93f78f Market orders wait for fresh data instead of filling on stale prices (#9535)
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
* Market orders wait for fresh data instead of filling on stale prices

A market order would previously fill immediately on the most recent
available data even when that data was older than StalePriceTimeSpan
(default one hour), only attaching a warning. This is unrealistic for a
coarse resolution asset (hour/daily) where the latest bar is the stale
previous close when the order is placed mid-bar or via an intraday
scheduled event.

The default fill models (FillModel, EquityFillModel, FutureFillModel) now
wait for fresh data instead of filling on a stale price, but only for hour
and daily resolutions; the order fills when the next bar closes. For
minute/second/tick subscriptions the previous behavior is kept (fill on
the stale price with a warning), since stale data there is a genuine gap
rather than a bar still forming.

Adds HourResolutionMarketOrderStalePriceRegressionAlgorithm, updates the
FillOutsideHours daily expectation, and regenerates statistics for the
hour/daily algorithms whose fills change. FutureOptionDaily buys and
liquidates a day apart now (a same-day buy + liquidate cannot fill on
daily data once stale fills are disabled).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Normalize and correct StalePriceTimeSpan XML docs

The interface and class docs now match and reflect the actual behavior:
the wait-for-fresh-data only applies to hour/daily resolutions, while
minute/second/tick subscriptions still fill on stale data with a warning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fill resting market orders at the bar open instead of the close

A hour/daily market order that was resting before the current bar opened
(it predates the bar - placed after the previous close or while waiting
for fresh data) now fills at the bar open, the price when trading resumed
(like a MarketOnOpen), instead of the bar close. Orders placed during the
bar still fill at the current/close price, so intraday mid-bar fills are
unchanged. Equity fills are unchanged (resting equity orders are already
converted to MarketOnOpen by QCAlgorithm.MarketOrder).

Adds the shared FillModel.GetMarketFillPrice helper used by the base
FillModel and FutureFillModel, a unit test, and regenerates statistics for
the affected daily/hour futures, index and crypto regression algorithms
(order counts unchanged, only fill prices).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add regression algorithm asserting resting market orders fill at the bar open

RestingMarketOrderFillsAtBarOpenRegressionAlgorithm buys a daily future on the
bar that delivers it (fills at that bar's close) and submits a liquidation while
the market is closed (overnight pulse, no fresh bar). The liquidation rests and
fills on a later bar at the bar open, not its close - asserting the new
GetMarketFillPrice behavior. The in-bar buy is asserted to fill at the close, for
contrast.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Carry the bar start time on Prices instead of re-reading the cache

Add Prices.Time (the bar start, mirroring BaseData.Time/EndTime), populated from
the source bar/tick in every GetPrices path. GetMarketFillPrice now uses
prices.Time directly instead of a second asset.Cache.GetData() lookup. Behavior
is unchanged (prices.Time equals the previously read cache time).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Add regression algorithm asserting in-session hour orders fill at the latest close

HourMarketOrderFillsAtBarCloseRegressionAlgorithm submits an hour resolution
market order mid-bar (via an intraday scheduled event) while the market is open,
using the default one hour StalePriceTimeSpan. It asserts the order fills
immediately at the latest available bar's close - not waiting and not at the bar
open - since the latest bar is within the stale window. Guards the resting-order
open-fill behavior against affecting ordinary in-session fills.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Regenerate custom fill model algorithm statistics for the open-fill change

CustomModelsAlgorithm and CustomPartialFillModelAlgorithm subscribe SPY at hour
resolution and their custom fill models delegate to base.MarketFill, so resting
orders now fill at the bar open. Regenerate their statistics (C#/Python) and the
inline expected statistics of the PEP8StyleCustomModelsWork test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:59:19 -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 affb275758 Revert "Market-hours aware intraday consolidation (#9516)" (#9528)
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
This reverts commit 9b89c166ff.
2026-06-12 09:27:54 -03:00
JosueNina 9b89c166ff Market-hours aware intraday consolidation (#9516)
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
API 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
Syntax Tests / 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
2026-06-11 10:02:26 -03:00
Martin-Molinero 3d87e39c95 Update pythonnet package version to 2.0.54
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 14:06:51 -03:00
JosueNina 9ccdbec8ee Add ContractMultiplier setter to Cfd via CfdSymbolProperties (#9328)
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 ContractMultiplier setter to Cfd via CfdSymbolProperties

* Fix regression tests

* Solve review comments

* Address new review comments

* Fix regression tests

* Use ContractSymbolProperties as base class

* Minor fix

* Address review comment
2026-04-08 10:47:47 -03: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 04993e2e2a Add securities when trading non added securities (#9312)
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 securities when trading non added securities

* Minor tests fixes

* Minor test fix

* Minor test fixes

* Minor fixes

* Minor test fix

* Minor fix
2026-03-03 17:09:21 -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
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
JosueNina a25e041793 Follow up: Fix weights calculation in VBaseSignalExport (#9281)
* Fix weights calculation in VBaseSignalExport

* fix empty portfolio handling

* Refactored signal export to compute and export weights for all portfolio positions, not just update targets.

* Update BuildCsv XML doc to clarify CSV output details

* Clarify comments on portfolio value and empty weights

* Stamp targets as is; we expect that users send all the weights they want to stamp. Extended the demo algorithm to use two positions to better demonstrate the intended usage of the VBaseSignalExport class.

* Minor changes to address PR review comments.

* Minor fix

---------

Co-authored-by: vb-vlb <volodymyr@vbase.com>
Co-authored-by: Volodymyr <vb-vlb@users.noreply.github.com>
2026-02-12 09:42:45 -03:00
JosueNina 63209a3fd3 Add Python overload for OptionPriceModelResult (#9277)
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
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
* Add python overload for OptionPriceModelResult constructor

* Solve review comments

* Update regression algorithms
2026-02-10 16:48:57 -03:00
JosueNina 76e01bbc42 Adds support for custom option pricing models (#9270)
* Initial solution

* Made Greeks a non-abstract class

* Add regression algorithms

* Solve review comments

* Minor fix

* Minor fix

* Remove unnecessary imports

* Fix issues with regression algorithms

* Solve review comments
2026-02-09 12:46:15 -03:00
Jhonathan Abreu 7f17838ad0 Fix crypto future margin model to reflect margin used (#9235)
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
API Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Fix crypto future margin model to reflect margin used

* Minor tests fixes

* Cleanup

* Cleanup
2026-01-27 13:40:36 -04:00
JosueNina 0854ab82da Default option filter now includes weeklies to prevent empty chains (#9162)
* Return weekly contracts if no standard contracts exist

* Fix unit and regression tests

* Centralize default expiration type flags

* Add ExcludeWeeklys() method

* Mark IncludeWeeklys() as obsolete since weeklies are now default
2025-12-31 10:11:46 -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
Martin-Molinero 2e67b9ad4f Feature net10 update (#9161)
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
* Feature update to net10

* Update to net10

* Update pythonnet to 2.0.51

* Remove dotnet config

* Remove net9

* Minor cleanup
2025-12-29 09:53:37 -03:00
Jhonathan Abreu ef1cf8e4df Replace RestShap with HttpClient (#9143)
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
* Replace RestShap with HttpClient

* Address peer review

* Minor fixes
2025-12-22 09:50:25 -04:00
Jhonathan Abreu b4401db512 Refactor ApiClient to use HttpClient (#9114)
* Refactor ApiClient to use HttpClient

* Minor fix

* Refactor and cleanup in ApiConnection

* Add normalized extension methods for string and stream json serialization

* Minor fixes

* Address peer review

* Minor fixes

* Minor fixes and peer review

* Race condition fix

* Minor changes

* Cleanup

* Minor fixes

* Minor fix
2025-12-10 15:40:46 -04:00
Jhonathan Abreu 9acd30c355 Make DataDictionary ordered by key (symbol) (#9105)
* Make DataDictionary ordered by key (symbol)

* Cache DataDictionary sorted items

* Minor tests fixes

* Minor changes

* Minor changes
2025-12-01 12:44:22 -04:00
Jhonathan Abreu c81f5d7d1a Seed securities by default (#9045)
Build & Test Lean / 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
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 SeedInitialPrices algorithm setting

This is true by default and indicates that the engine will seed initial prices right after the security is added or selected

* Update regression algorithms

* Update regression algorithms

* Update regression algorithms

* Refactor default securities seeding

* Minor fix

* Minro fixes

* Cleanup

* Updated and add regression algorithms

* Address peer review

* Centralize logic to get last known data for multiple securities

* Some cleanup

* Minor build fix

* Minor fixes

* More logic centralization

* Some more cleanup

* Cleanup

* Update regression algorithms and minor fixes

* Update regression algorithms

* Minor fix

* More minor fixes

* Update regression algorithms

* Cleanup

* Minor test fix

* Address peer review

* Minor fix and performance improvement

* Fix to seed open interest data

* Minor test fixes

* Address peer review

* Minor change

* Minor revert

* Minor fixes and improvements

* Disable initial seeding by default

* Minor fixes

* Cleanup

* Cleanup

* Minor fix
2025-11-18 13:05:56 -04:00
Martin-Molinero 4961844f82 Refactor user define universe handling (#9088)
* Refactor user define universe handling

- Normalize user define universe additions and removals to behave like
  other subscriptions without requiting special handling

* Minor fixes
2025-11-18 12:29:05 -03:00
Jhonathan Abreu f4bab98b00 Update Pythonnet version to 2.0.50 (#9070)
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
2025-10-31 16:38:26 -04:00
Martin-Molinero 2faf921731 FixComposer Assembly Resolution (#9066)
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
API Tests / build (push) Has been cancelled
2025-10-28 09:26:12 -03:00
Martin-Molinero 89f3968eef Fix performance degradation on expirying assets (#9065)
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 performance degradation on expirying assets

- Options would expire and get removed, when the universe removed the
  security it would never be reseted on universe selection, causing
  leaks
- Minor improvement for composer assembly loading
- Minor improvement for loading exception interepreters, so it uses
  composer

* Minor regression test fix

* Add new benchmark algorithm
2025-10-27 18:17:53 -03:00
Martin-Molinero 6916636e8e Remove Future expiry date from data & use Bank Holidays For Expirations (#8580)
Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Use Futures Bank Holidays For Expirations

* Minor improvements

- Futures will be stored by their contract month, not expiry

* Delete dairy future products

* Minor test fixes
2025-10-24 17:18:20 -03:00
Martin-Molinero 9ab9fe5f2b Python performance improvement (#9052)
Research Regression Tests / build (push) Has been cancelled
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
* Minor tweak to cache liquidation fees

* Result handler cleanup

* Update pythonnet version to 2.0.49
2025-10-21 12:34:52 -03:00
Martin-Molinero 6c95372d27 Disable OHLC session tracking by default (#9046)
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
* Disable OHLC session tracking by default

* Minor test fix
2025-10-17 15:59:50 -03:00
JosueNina ff1638f653 Support CustomData in SecurityCache.GetData(PyObject type) method (#9036)
* Initial Solution

* Add regression algorithms

* Solve review comments

* Update CustomDataSecurityCacheGetDataRegressionAlgorithm.py

---------

Co-authored-by: Martin-Molinero <martin.molinero1@gmail.com>
2025-10-16 10:37:00 -03:00
Martin-Molinero d8d6deb675 Add support for Brokerage ActionRequired message type (#9040)
Python Virtual Environments / 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
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
* Add support for Brokerage ActionRequired message type

* Minor syntax check typo fix
2025-10-15 13:05:14 -03:00
Martin-Molinero 81b2d45440 Add Consolidator Optional Start time (#9034)
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 consolidators optional start time. Adding tests
2025-10-14 11:04:21 -03:00
JosueNina fda4859b5a Support Future Options for Continuous Futures (#9022)
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
Regression 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
* Support Future Options for continuous futures

* Solve review comments

* Resolve review comments

* Improve regression algorithms

* Use canonical symbols in OptionChains lookups

* Solve review comments
2025-10-13 18:20:12 -03:00
Martin-Molinero 9fa2630dc8 Add implicit security to symbol (#9032)
- Add implicit conversion from security to symbol. Adding regression
  algorithms
2025-10-13 17:58:57 -03:00