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
This commit is contained in:
Jhonathan Abreu
2026-03-03 12:18:10 -04:00
committed by GitHub
parent ffe31b8d3d
commit 9573eea52e
12 changed files with 352 additions and 54 deletions
@@ -65,6 +65,5 @@ class IndexOptionCallButterflyAlgorithm(QCAlgorithm):
call_butterfly = OptionStrategies.call_butterfly(self.spxw, otm_strike, atm_strike, itm_strike, expiry)
price = sum([abs(self.securities[x.symbol].price * x.quantity) * self.multiplier for x in call_butterfly.underlying_legs])
if price > 0:
quantity = self.portfolio.total_portfolio_value // price
quantity = int(self.portfolio.total_portfolio_value // price)
self.tickets = self.buy(call_butterfly, quantity, asynchronous=True)