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
* Convert daily resolution market orders to MarketOnClose/MarketOnOpen
A market order placed intraday (e.g. through a scheduled event) on an
asset subscribed only at daily resolution has no fresh intraday price to
fill against, so it was filling at the stale previous daily close. This
is common when mixing daily resolution assets with minute resolution
assets or intraday scheduled events.
QCAlgorithm.MarketOrder now converts these orders so they fill at a real
daily open/close instead of the stale previous close:
- market closed (any resolution): MarketOnOpen, as before
- market open, daily-only subscription: MarketOnClose (today's close),
or MarketOnOpen (next open) when already within the MarketOnClose
submission buffer near the close
Assets with intraday data are left untouched, and the conversion is only
applied in backtesting; in live trading an open-market market order fills
at the real current price.
Adds DailyResolutionMarketOrderConversionRegressionAlgorithm covering the
MarketOnClose and MarketOnOpen conversion paths plus a minute resolution
asset that is correctly left as a regular market order.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Minor fix
* Reword conversion warning: "current market price" instead of "real current price"
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Update regression stats affected by daily market order conversion
Daily-resolution market orders placed intraday are now converted to
MarketOnClose/MarketOnOpen so they fill at a real daily open/close
instead of the stale previous close. This shifts the affected fills:
- IndexOptionCall{ITM,OTM}ExpiryDaily: the SPX option entry, placed one
minute after the open, now fills at the daily close. Same economics,
one extra data point and a new order list hash.
- AllShortableSymbols (C# + Python): an intraday order's type changed
from Market to a converted order; identical End Equity, new hash.
- ResolutionSwitchingAlgorithm sampling test: the RemoveSecurity
liquidation (fired at 15:50) previously filled at the stale previous
close; it now converts, shifting the equity/performance samples.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Revert expected data point count change
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* task: remove extraneous defaults from Isolator/MonitorTask
- ExecuteWithTimeLimit -- the only user of private MonitorTask --
already defines the defaults for memoryCap & sleepInterval
* fix: typos
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
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
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Add LocateBroker (string) and LocateId (string) so algorithms can attach
Reg SHO locate information to short equity sales routed through Bloomberg
EMSX. These map to the EMSX_LOCATE_BROKER and EMSX_LOCATE_ID fields on the
EMSX order ticket (LocBrkr / LocId). The TerminalLink brokerage emits
EMSX_LOCATE_REQ = "Y" automatically whenever either identifier is set on
a short equity sale, so no separate "required" flag is exposed here.
Without these properties the TerminalLink brokerage has no way to identify
the lender on a short sale, and prime brokers reject the order.
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
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 VIX Mini Futures (VXM) support
Adds complete LEAN support for VIX Mini Futures (VXM) traded on CBOE:
- Add Futures.Indices.VIXMini = "VXM" constant
- Add expiry function: 30 days before third Friday of following month
- Add symbol properties: multiplier 100, tick 0.01 (USD)
- Add 15 test date pairs for 2023-2025 to FuturesExpiryFunctionsTestData.xml
- Add [TestCase(VIXMini, EightOClockChicagoTime)] to IndicesExpiryDateFunction test
- Add market hours configuration mirroring VX trading hours
ClosesQuantConnect/Lean#6655
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* Fix VXM expiry holiday validation and add margin file
- Replace single `if` holiday check with `while` loop using
`IsCommonBusinessDay()` to ensure the computed expiry date
is always a valid tradable day (not just one step back)
- Fix test data: 2025-03-19 -> 2025-03-18 (April 18 2025 is
Good Friday, a CFE holiday, shifting the expiry back)
- Add Data/future/cfe/margins/VXM.csv margin file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
GF's minimum_price_variation in the symbol-properties database was
0.025 (cents per pound), inconsistent with every other livestock entry
which uses dollars per pound. CME's official spec is $0.00025/lb
($12.50/tick on 50,000 lb), matching LE and HE.
With price_magnifier=100 the prior value produced an effective per-
contract tick value of $1,250 instead of $12.50, putting algorithm-
rounded prices on a grid 100x coarser than the exchange grid and
causing rejected/unreachable orders on GF.
https://www.cmegroup.com/markets/agriculture/livestock/feeder-cattle.contractSpecs.html
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 saleCondition/exchange overload to UpdateQuote
- normalize exchange via GetPrimaryExchange in UpdateQuote/UpdateLastTrade
- cover exchange mapping with combined test
* 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
* Fix SessionConsolidator skipping daily bars on manual Update
* Fix SessionConsolidator bar timestamp when no data arrives for a trading day
* Address review comments
* Minor fix
* Move initialization logic to start of AggregateBar
* 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.
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
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* Default to all market hours when no symbol is provided
Add no-symbol overloads of `AfterMarketOpen`, `BeforeMarketOpen`,
`AfterMarketClose` and `BeforeMarketClose` so scheduled events can be
defined without referencing a specific security. Per-date, the helpers
pick the earliest open / latest close across the algorithm's
non-always-open exchanges, falling back to US equities (SPY) when no
eligible security is subscribed. US equities are skipped during the
walk since SPY's exchange hours already represent them.
Closes#9461.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Test that option contracts dedupe to one exchange hours entry
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* 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>
Implement WaveTrendOscillator (bar indicator) per the linked issue. Adds
the indicator class, the WTO helper in QCAlgorithm.Indicators.cs, unit
tests inheriting CommonIndicatorTests<IBaseDataBar>, and the reference
CSV under Tests/TestData/.
The oscillator is computed from the typical price (HLC/3): an EMA
smooths it (ESA), a second EMA tracks its absolute deviation (D), the
normalized channel index (HLC3 - ESA) / (0.015 * D) is smoothed by a
third EMA to produce WT1, and an SMA of WT1 produces the signal line
WT2. Crossovers between WT1 and WT2 are commonly used as entry and exit
signals for momentum reversals.
Reference values were generated with TA-Lib (talib.EMA + talib.SMA)
following the script posted by @LouisSzeto in the issue thread.
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
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
Skip setting the default "QCAlgorithm.Download(): User Agent Header"
when the caller already supplied a User-Agent in the headers dictionary.
The check uses HttpRequestHeaders.Contains, which matches header names
case-insensitively per the HTTP spec.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Syntax Tests / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
* fix: add AJY future-option expiry definition
- map AJY (AUD/JPY) FOP to SecondFridayBeforeThirdWednesdayOfContractMonth
- prior fallback to the AJY HMUZ-only future expiry collapsed serial-month FOPs (e.g. AJYN6) into their underlying quarterly Symbol
* fix: add ANE and ECD future-option expiry definitions
- map ANE (AUD/NZD) and ECD (EUR/CAD) FOPs to SecondFridayBeforeThirdWednesdayOfContractMonth
- prior fallback to the HMUZ-only future expiry collapsed serial-month FOPs into their underlying quarterly Symbol
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
- map EAD (EUR/AUD) FOP to SecondFridayBeforeThirdWednesdayOfContractMonth
- prior fallback to the EAD HMUZ-only future expiry collapsed serial-month FOPs (e.g. EADN6) into their underlying quarterly Symbol