Improve performance of OptionChain (#8359)
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
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled

- Improve performance of OptionChain by creating a single pandas df
This commit is contained in:
Martin-Molinero
2024-10-04 20:03:53 -03:00
committed by GitHub
parent e16b27f089
commit 0a2c05ab1e
5 changed files with 84 additions and 22 deletions
@@ -37,7 +37,7 @@ class OptionChainFullDataRegressionAlgorithm(QCAlgorithm):
# Get the contract with the latest expiration date.
# Note: the result of df.loc[] is a series, and its name is a tuple with a single element (contract symbol)
self._option_contract = contracts.loc[contracts.expiry.idxmax()].name[0]
self._option_contract = contracts.loc[contracts.expiry.idxmax()].name
self.add_option_contract(self._option_contract)