* 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
* fix: support BNFCR alternative collateral in CryptoFutureMarginModel for Binance (#9339)
* refactor: use classic switch in BinanceFuturesBrokerageModel.GetBuyingPowerModel
* fix: CryptoFutureMarginModel in BinanceCoinFuturesBrokerageModel
* refactor: simplify BinanceCryptoFutureMarginModel collateral conversion
* fix: restore IsCryptoCoinFuture guard in BinanceCryptoFutureMarginModel
* refactor: simplify BinanceCryptoFutureMarginModel to direct BNFCR lookup
Replace IsStableCoinWithoutPair foreach loop with a single TryGetValue
check for BNFCR. BNFCR is EU/EEA-only (MiCA Credits Trading Mode) so
the lookup is a no-op for all other users. Amount reflects availableBalance
from the Binance API — the total cross-margin pool already aggregated by
Binance — making the > 0 guard correct and avoiding CashBook iteration.
* feat: add regression algorithm for BNFCR as sole collateral on Binance USDⓈ-M futures
Asserts end-to-end that EU/MiCA accounts with zero USDT and BNFCR as
the only collateral can open ADAUSDT positions. Verifies buying power,
holdings AbsoluteHoldingsCost, TotalSaleVolume, TotalMarginUsed,
maintenance margin consistency and TotalUnrealizedProfit accuracy.
* refactor: BNFCR presence gate with CashBook iteration for supplementary collateral
Replace IsStableCoinWithoutPair and hardcoded asset list with CashBook
iteration gated by BNFCR presence. Binance controls which assets are in
the account — all with non-zero walletBalance are valid collateral.
Add tests for BNFCR zero balance and BTC collateral conversion.
* refactor: aggregate all collateral without reference equality check
* fix: shared collateral deduction across quote currencies for EU/MiCA BNFCR mode
- Extract virtual SharesCollateral in CryptoFutureMarginModel
- Override in BinanceCryptoFutureMarginModel: BNFCR present → all USDⓈ-M share pool
- Add BNFCRCurrency const
- Add SharedCollateralDeductsMaintenanceMarginAcrossQuoteCurrencies unit test
- Refactor regression algorithm to assert shared collateral across ADAUSDT/ETHUSDC
* refactor: remove dead IsCryptoCoinFuture guard from BinanceCryptoFutureMarginModel
- Remove IsCryptoCoinFuture() check (coin futures use BinanceCoinFuturesBrokerageModel, not this model)
- Call base.GetTotalCollateralAmount() instead of duplicating primaryCollateral.Amount
- Remove CoinFutureDoesNotIncludeBnfcrAsCollateral test (tested wrong margin model)
* refactor: make GetCollateralCash private in CryptoFutureMarginModel
- No longer accessed by subclasses after removing direct collateral checks from BinanceCryptoFutureMarginModel
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
* 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
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
* 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>
* 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
Regression 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
Python Virtual Environments / 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
* Increase option strike digits precision to 6
- Increase option strike digits precision to 6. Adding unit test
* test:fix: couple of build tests
* fix:test: Asset CUSIP and OrderListHash in Regression Algorithms
* test:fix: several regression algos
* test:fix: old Symbol CUSIPs to new ones
---------
Co-authored-by: Romazes <romazes20@gmail.com>
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
* Refactor user define universe handling
- Normalize user define universe additions and removals to behave like
other subscriptions without requiting special handling
* Minor fixes
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
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
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 ProcessSplitSymbols crash during live mode warmup
Fixes InvalidOperationException when CancelOpenOrders is called during warmup in live/paper trading mode.
When historical splits are replayed during live mode warmup, ProcessSplitSymbols attempts to cancel open orders for option contracts, but CancelOpenOrders throws an exception during warmup.
The fix adds an early return when algorithm.LiveMode && algorithm.IsWarmingUp. This is safe because in live/paper trading, current positions already reflect historical splits.
Includes unit tests validating the fix.
* Some improvements and more tests
- Ignore splits during warmup for backtesting and live trading. Adding a
regression algorithm reproducing issue
* Minor fix
---------
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
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 VBaseSignalExport
* Add a VBaseSignalExport feature that allows signals to be stamped with the help of the ValidityBase REST API.
* Addressing review comments
* Create DefaultApiBaseUrl const in VBaseSignalExport
* Add vbase signal export demonstration algorithm
* Set initial parameters for VBaseSignalExportDemonstrationAlgorithm
* Refactor VBaseSignalExport and demonstration algorithm: update symbol list, extend end date, and improve API base URL handling
* Initialize allowed security types in VBaseSignalExport and fix symbol reference in CSV generation
* Adjust rate limiter for vBase signal export to allow 6 requests per hour for better performance
* Minor tweaks
---------
Co-authored-by: Volodymyr Bobko <volodymyr.bobko@un.org>
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>