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: add webull brokerage core integration
- add BrokerageName.Webull enum value
- add WebullBrokerageModel supporting Equity, Option, IndexOption
- add WebullFeeModel with zero commission for equity/option, tiered index option fees (SPX, SPXW, VIX/VIXW, XSP, DJX, NDX/NDXP), 0.6% crypto fee
- register Webull in IBrokerageModel factory switch and GetBrokerageName
- add webull config keys and live-webull environment to Launcher/config.json
- add WebullBrokerageModelTests (CanSubmitOrder, GetFeeModel)
- add WebullFeeModelTests covering all index option tiers and crypto
* refactor: split webull supported order types per security type
- replace flat _supportSecurityTypes/_supportOrderTypes with _supportedOrderTypesBySecurityType dictionary
- options and index options: Limit, StopMarket, StopLimit only
- equity, future, crypto: Market, Limit, StopMarket, StopLimit, TrailingStop
- add WebullOrderProperties with OutsideRegularTradingHours flag
- add messages for unsupported order type validation
* fix: add market order type to option and index option supported orders
* chore: add webull crypto symbols to symbol-properties-database
* test: consolidate webull fee model and brokerage model tests
- merge per-tier and per-symbol [Test] methods into [TestCase]/[TestCaseSource] parameterized tests in WebullFeeModelTests
- replace CreateIndexOptionSecurity/CreateOptionSecurity/CreateCryptoSecurity with single CreateSecurity(SecurityType, decimal, string) helper
- rename test methods to PascalCase (drop underscores) in WebullBrokerageModelTests
- remove section-separator comments from WebullBrokerageModelTests
- update Launcher/config.json for local Webull UAT environment
* remove: restriction GTC for Option and Buy side only
* refactor: limit webull to equity and options
- remove crypto and future support from order types and tests
- remove crypto fee logic and crypto symbol-properties rows
- reject market orders with outsideRth on equity
- log info when market order uses non-day tif
* Throw clear error when AddData is called with a non-class first argument from Python
Calls like self.add_data("VIX", Resolution.DAILY) routed through CreateType, which
silently built a dynamic assembly named after the string and returned a fake type
whose activator factory tried to invoke the str like a function. The downstream
'str' object is not callable PythonException surfaced confusingly (and could
manifest as an apparent hang depending on where it was caught), making the actual
mistake hard to diagnose.
Validate the PyObject up front via TryCreateType in the AddData(PyObject, ...)
entry points and throw an ArgumentException pointing the user at AddEquity /
AddForex / etc. when the argument is not a custom data class.
* Improve the error message
Use only two alternative methods as examples, as we don't need an exhaustive list.
* Allow SetAccountCurrency after SetCash without throwing
Previously, calling SetAccountCurrency after SetCash threw an
InvalidOperationException. The portfolio manager now switches the
base account currency in place: the previous Cash entry (and its
balance) is preserved in the CashBook, and a notice is logged. When
the new account currency matches the existing one, an optional
startingCash overrides the previously set amount and the override
is logged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Simplify SetAccountCurrency remarks and drop unused message
Tightens the XML remarks to two cases (different currency: keep previous
in its own entry; matching currency: override). Also removes the now
unused CannotChangeAccountCurrencyAfterSettingCash string since the
portfolio no longer throws.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Simplify in-line comment in SetAccountCurrency
Drops the "Undo that migration" wording (residue from a previous fix
attempt) and just describes what the branch does: keep the previous
balance in its own currency entry while the new account currency starts
at zero.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Differentiate implicit vs explicit SetCash on account currency switch
SetCash(decimal) is currency-agnostic: the amount is "this many units of
the (eventual) account currency". Switching the account currency now
re-labels the amount onto the new currency instead of preserving the
previous one. SetCash(symbol, ...) for the current account currency keeps
the old behaviour of preserving the balance in its own CashBook entry.
Splits the existing tests by overload and adds a starting-cash variant
for the explicit case.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Mark base cash explicit on any SetCash(symbol, ...) call
Broaden _baseCashSymbolSetExplicitly so any call to the explicit-currency
overload signals the user is committing to named currencies, not just
calls whose symbol matches the current account currency. SetAccountCurrency
then preserves the previous base-currency balance in its own CashBook
entry whenever the user has touched the explicit overload at all.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.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
* Improves Null Key Handling in Python
We aim to mimic the following behavior:
```python
>>> d = {1:2}
>>> None in d
False
>>> d.get(None) is None
True
>>> d.pop(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: None
>>> d.pop(None, None) is None
True
```
* Reverts dispose change
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax 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
Python Virtual Environments / build (push) Has been cancelled
* Fix: Reject unsupported 4-leg ComboLegLimit orders in InteractiveBrokersBrokerageModel (#9287)
* Minor tweaks
---------
Co-authored-by: Ahmed Ali <ahmedalli79x@gmail.com>
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
Build & Test Lean / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
* Implement indicator-based option price model
This model uses IV and Greeks indicators to implement Lean's own option pricing model
* Minor fixes
* Address peer review
* Minor tests fixes
* Make the indicator based price model the default for options
* Address peer review
* Cleanup and minor changes
* Support indicators configuration for new pricing model
* Some cleanup
* Add QL option price model example algorithm
* Return lean models from static helpers
* Minor tests fixes
* Minor test fixes
* Address peer review
* Cleanup
* Fix unit tests
* Move QL models to OptionPriceModels.QuantLib.*
* Add forward tree helper method
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Syntax Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* feat: warn on manual brokerage orders not tracked by Lean
Add a warning in DefaultBrokerageMessageHandler to notify users when orders are placed manually through the brokerage and are not observed by Lean. The warning is emitted only once per session and includes a message with documentation guidance.
* refactor: message for unrecognized order warning
* refactor: unrecognized order messaging with brokerage IDs
* refactor: unrecognized order msg
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
* Some fixes for new C# enums handling in Pythonnet
* Minor changes and cleanup
* Update Pythonnet version to 2.0.45
* Minor changes
* Minor fix
* Minor fix
* Minor change
* Minor change
* Minor unit test fix
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
* Make ExtendedDictionary extend IDictionary
* Revert "Make ExtendedDictionary extend IDictionary"
This reverts commit bbbe9c769be682767cb9e487b904480376b53596.
* Make ExtendedDictionary key a type parameter
* Make SecurityPositionGroupModel an ExtendedDictionary
* Add unit tests
* Minor change
* Add more unit tests and other minor changes
* Add Count and ContainsKey to BaseChain
* Update pythonnet version to 2.0.43
* Update some python regression algorithms
* Minor regression algorithms fix
* Make CashBook and ExtendedDictionary
* Minor changes
* Minor changes
* Update pythonnet version to 2.0.44
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
API Tests / build (push) Has been cancelled
* EUREX data
EUREX data model and sample data
* Add EUREX futures expiry function and sample algorithms
* Add EuroStoxx50 futures map and factor files
* Reduce eurex data for repo
* Map eurex market to primary exchange
* Update Euro Stoxx 50 (FESX) map and factol files
* Update Euro Stoxx 50 (FESX) minute data
* Added EURSD data
* Added 2 basic FESX futures algorithms in CSharp and Python (#2)
* Add regression algorithms
* Update regression algorithms and data
* Minor change
* Cleanup
---------
Co-authored-by: paulius-an <118921953+paulius-an@users.noreply.github.com>
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Initial options universe with greeks implementation
* Options universe improvements
* Address peer review
* File based options universe fixes and improvements.
- Adjust OptionUniverse start-end times and period.
- Adapt unit tests and some algorithms to pass with new options universe selection.
* Updated options regression algorithms stats for new universe data
* Updated options regression algorithms stats for new universe data
* Updated options regression algorithms stats for new universe data
* Updated options regression algorithms stats for new universe data
* Updated options regression algorithms stats for new universe data
* Option chain provider with new options universe
* Allow canonical option history requests
* Address peer review
* Address peer review
* Fix symbols parsing in OptionUniverse
* Fix universe selection subscriptions start time to not include extended market hours
* Minor changes
* Minor changes
* Peer recommended changes and fixes
* Update regression algorithm stats
* Update regression algorithms stats and minor fixes
* Fix option chain provider history request
* Round option indicators values
* Added option universe csv header property
* Update regression algorithms stats
* Update regression algorithms stats
* Data fixes and regression algos stats update
* Unit test fixes
* Minor changes
* Option chain handling in live trading data feed
* Minor changes
* Added processed data provider
* Fix thread-safety violation in Slice class
* Minor change
* Update options filter universe API to use OptionUniverse data
Add new filter methods for greeks, IV and open interest
* Option filter universe api updates
* Add OptionUniverse history regression algorithms
* Add regression algorithms for new options filter universe api methods
* Added options greeks data and updated regression algorithms
* Address peer review
* Address peer review
* Add more assertions to new options filter api regression algorithms
* Minor performance improvement.
Reduce greeks binomial model steps to 140
* Minor tests updates
* Greeks numerical models performance improvements
* Greeks numerical models performance improvements
* Revert array pool change for option pricing numerical models
* Update default dividend yield provider depending on option type
* [TEST]
* Add helper method con calculate time till expiration
* Use double in price option numerical models
* Implied volatility calculation improvements
- Adjust root finding method accuracy as a factor of the option price
- Use BSM to get a first guess
* Cleanup
* Some regression algorithms and unit tests cleanup
* Regression tests updates after rebasing from master
* Add universe files
* Self review and cleanup
* Minor regression tests updates after rebase
* Fix: set data time zone to same as exchange tz for options universes
* Minor change
* Minor change
* Fix for live trading options universe selection
* Keep underlying when aggregating collections in BaseDataCollectionAggregatorEnumerator
* Update index options regression algorithms stats
* Minor change
* Address peer review
* Memory usage improvements
* Minor build fix
* Minor changes and test fixes
* Cache symbols in OptionUniverse
* Cleanup
* Fix index option creation in OptionUniverse
* Use cached underlying SID when parsing from string
* Abstract symbols cache to BaseDataCollection
* Return actual underlying symbol when mapping decomposing ICO ticker
* Address peer review
* Minor performance improvements reduce garbage
* Limit Symbols and SIDs cache size to help with memory usage
* Minor fix in symbols and sid cache cleanup
* Build fix
* Lazily parse greeks on individual access
* Cleanup and tests
* Address peer review
* Minor greeks fix
---------
Co-authored-by: Martin Molinero <martin.molinero1@gmail.com>
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* refactor: adding OrderId in GroupOrderManger
* feat: new support of OrderTypes in TradeStationBrokerageModel
feat: unSupported OrderTypes in CanUpdateOrder's TradeStationBrokerageModel
* feat: AllOrNone property in TradeStationOrderProperties
* feat: unsupported SubmitCrossZero of Combo Order in TSBrokerageModel
* test:feat: submit / update CrossZero Combo Orders
* feat: new Message Brokerage error message
refactor: use new Message in TradeStationBrokerageModel
* feat: setter of Id in GroupOrderManager
* feat: new constructor of GroupOrderManager
* feat: develop GroupOrderCacheManager service
* fix: groupOrderManger.Id in OrderProvider
* fix: incrementOrderGroupOrderManagerID in BrokerageTransactionHandler
feat: add _groupOrderManagerId in OrderProvider
* remove: extra semicolon
* refactor: prevent increment GroupOrderID
* feat: add new Exchanges
* feat: Try Get Group Combo Orders extension
* refactor: ComboORderType in TSBrokerageModel
* remove: implementing of prop ID in GroupOrderManager
* refactor: UnsupportedCrossZeroByOrderType message
* fix: warning of UnsupportedCrossZeroByOrderType
* fix: several exchanges code based on tradier docs
https://documentation.tradier.com/brokerage-api/reference/exchanges
* feat: add missed Exchange in Global class
* refactor: possible update LimitPrice in TSBrokerageModel
test:feat: validate upddate LimitPrice of ComboLimit Order
* refactor: GroupOrderCacheManager
remove: TryGetGroupCachedOrders from extension
* refactor: exchange SPHR to MIAX_SAPPHIRE
* remove: Exchange BYX cuz It is BATS_Y
* refactor: change position of Exchange C2
* refactor: change constructor's access modifier in class Exchange
* feat: TryCrossPositionOrder
feat: helper methods to CrossPosition
* refactor: get rid CrossOrder +UTests
* feat: test simulator of cross zero orders request
* remove: callback from TryCrossPositionOrder
rename: TryCrossPositionOrder -> TryCrossZeroPositionOrder
feat: handle event of CrossZeroOrder
feat: new prop in CrossZeroOrderRequest
test:feat: write working test imitate of CrossZeroOrdering and assert different params
* feat: temp collection to keep CrossZeroOrder with Lean
* refactor: flag which indicate should we place crossZero order with LeanEvent or not
* refactor: change access modifier
* fix: CrossZero tests
* refactor: property collection instead of variable
* feat: lock context of CrossZeroOrder
feat: helper method for CrossZeroCollection
* refactor: test of cross brokerage ordering
* refactor: CrossZero Brokerage
* fix: lock area
* feat: Update CrossZero Ordering
refactor: CrossZeroOrders tests
* feat: additional test case for CrossZeroOrdering
* feat: Invalid OrderStatus when FirstPart of CrossZero ordering try to place
feat: message property in CrossZeroOrderResponse
refactor: CrossBrokerageTest a little bit
* feat: PossibleUpdateCrossZeroOrder
* refactor: UpdateCrossZeroOrder
* refactor: TimeOut for resetEvent
* refactor: crossZeroOrder change DateTime UtcNow on specific time
refactor: change action scenario for Filled FirstPart of CrossZeroOrder
* refactor: change firstPartQuantityproperty to link of FirstPartOfCrossZero order completely
fix: crossZeroOrder test put orderStatus internally
* feat: additional orderType in CrossZeroOrder tests
* test:remove: not use GetOrderCrossesZero()
* refactor: extra paddings
* rename: TryGetUpdateCrossZeroOrderQuantity instead of IsPossibleUpdateCrossZeroOrder
* refactor: CrossZeroOrder process and models
* remove: interface ICrossZeroOrderRequest
* feat: TradeStation NotSupportUpdate of CrossZeroOrder quantity
* feat: add license
remove: extra validation of variable
* refactor: add validation of quantity update in TradeStationBrokerageModel
* test:feat: canUpdate of TradeStationOrder
* refactor: reuse OrderEvent when we handle FirstPartCrossZeroOrder
* remove: assignment of filled quantity of FirstPartCrossZeroOrder
* Add support for FTP notifications
* Add optional parameters for SFTP notifications with private key
* Add optional "secure" parameter for FTP notifications.
Improve FTP notifications constructor and input checks.
* FTP notification improvements.
Add public key property.
Add multiple constructors and methods for FTP and SFTP notifications with either password or SSH keys.
Encode file contents.
* Address peer review
Add support for FTP notification with string contents
* Minor changes
* Minor changes
* Remove public key argument
* Fixes and minor changes
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Replace currency string formatting with Lean currency symbols.
Also clean up orders tags from having redundant information.
* Setting default order tag only after price currency is properly set
* Minor fixes and new unit tests
* Minor fixes
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
After running the regression tests in my local pc, I found some of them
were failing in the stats. Then, after debugging them I realized it was
because some of the strings were being casted without using
InvariantCulture parameter.
Regression Tests / build (push) Has been cancelled
Research Regression 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
* Shortable modeling improvements
- Do not limit live trading because of shortable model, will send
algorithm warning
- Add Interactive brokers shortable provider
- Minor LocalDiskShortableProvider API changes
* Fix shorted order update
- Fix shorted order update. Updating regression algorithm
* Minor improvement
* Address reviews
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
* Candlestick charts base implementation
* Series and Candlestick series json serialization
* Some cleanup
* Add AddPlot method for candlestick series to QCAlgorithm
* Remove Values property from ISeriesPoint
* Add candlestick QCAlgorithm.Plot trade bar methods
* Implement candlestick series re-sampling
* Add more SeriesSampler unit tests
* Add examples of candlestick charts usage to exisiting charting algorithm
* Address peer review
* Address peer review
* Derive Candlestick from Bar
* Sampler changes
* Add new series types from the cloud
* Add more candlestick series sampler tests
* Minor cleanup
* Minor changes
* Add trailing stop orders base implementation
* Handle trailing stop order prices rounding
* Implement trailing stop orders fill logic
* Minor fill model changes
* Add ApplySplit to fill model interface for models that might need to be aware of splits.
Filling trailing stop orders require keeping track of min/max prices, which need to be split adjusted.
* Add brokerage order updated event for communicating certain order types prices changes
* Add order update event args class for brokerage side order updates
* Revert IFillModel.ApplySplit
* Add trailing stop orders regression algorithm
* Updated order ticket demo algorithm to include trailing stop orders
* Some cleanup
* Support trailing stop orders in IB brokerage model
* Some cleanup
* Fix failing tests
* Fix failing regression algorithm
* Address peer review
* Add trailing stop price calculation unit tests
* Minor changes
* Minor change
Build & Test Lean / 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
* Implement indicator history through a rolling window
* Minor changes and extend unit tests
* Add regression algorithms
* Minor changes
* Update regression algorithms examples
* Move resizing logic from IndicatorBase to RollingWindow
* Add unit tests and other minor changes
* Minor fix
* Add unit tests and other minor changes
* Add unit test
* Fix PositionGroupBuyingPowerModel quantity for delta calculation
The model was calculation the order size that required a margin equal to
the given delta. This fix makes it so that it calculates the position
group order quantity required to get the given buying power delta,
taking into account the holdings for the existing position group in the portfolio.
* Fix PositionGroupBuyingPowerModel quantity for delta calculation
* Add unit tests
* Add unit tests
* Add unit tests
* Housekeeping
* Housekeeping
* Adapt unit tests and move messages to Messages class
* Improve quantity calculation for target BP loop
- PositionGroup.Quantity is now always positive.
- Added PositionGroupExtensions.Closes method and use it to check if reducing a position in PositionGroupBuyingPowerModel.GetPositionGroupBuyingPower. This is necessary since now a PositionGroup side is always "long" (see first bullet point).
* Improvements
* Improvements and new PositionGroup unit tests
* Unit tests improvements
- HasSufficientBuyingPowerForOrder test cases were completely updated to
make it accurate in terms of Lean's margin calculation.
- BuyingPowerForPositionGroupCalculation test was fixed in order to get
the correct expected result.
* Fixes for failing tests
* Added additional check to OptionStrategyMarginCallEventsAlgorithm
* Improve documentation comments
* Fix option strategies BuyingPowerForPositionGroupCalculation unit test
* Fix PositionGroupBuyingPowerModel.GetPositionGroupBuyingPower
Also address peer review
* Minor changes
* Update unit tests for new inverse strategies
Also fixed PositionGroupExtensions.WithQuantity to resolve inverse
strategy
* Minor fix
* Allow target/delta to go to the opposite direction of the position group
* Housekeeping
* Handle quantity for target/delta BP request for different reference position group
* Revert removal of PositionGroupBuyingPowerParameters.Direction
* Minor changes
* Peer review
* Minor tweaks on the position group buying power model
* Minor fix
Regression 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
* Implement Trailing FreePortfolioValue
- Implement Trailing FreePortfolioValue by default, users will be able
to set it to a fixed number if desired. Adding regression algorithm
- Setting the default 'MinimumOrderMarginPortfolioPercentage' from 0 to
0.1% of the TPV to avoud tiny trades by default
* Update existing regression algorithms
* Address reviews
- Send warning message to the user if a trade does not happen due to the
default setting of the minimum order margin percentage value
* Address reivews
* Rename TotalPortfolioValueLessFreeBuffer
* Update new regression algorithm
* Handle unsupported orders and add unit tests
- Capture more Tradier Brokerage order limitations
- Add unit tests to cover this changes
* Enhance implementation and add more unit tests
* Enhance implementation and add unit test
* Remove IsMarketOrderGTC condition
* Remove error message MarketOrderIsGtc