Update regression algorithms

This commit is contained in:
Jhonathan Abreu
2025-10-17 10:58:41 -04:00
parent 0678de396d
commit 30c19e22a8
24 changed files with 62 additions and 99 deletions
@@ -26,16 +26,13 @@ class CustomDataSecurityCacheGetDataRegressionAlgorithm(QCAlgorithm):
self.add_data(Bitcoin, "BTC", Resolution.DAILY)
seeder = FuncSecuritySeeder(self.get_last_known_prices)
self.set_security_initializer(lambda x: seeder.seed_security(x))
def on_data(self, data: Slice) -> None:
bitcoin = self.securities['BTC'].cache.get_data(Bitcoin)
if bitcoin is None:
raise RegressionTestException("Expected Bitcoin data in cache, but none was found")
if bitcoin.value == 0:
raise RegressionTestException("Expected Bitcoin value to be non-zero")
bitcoin_from_slice = list(data.get(Bitcoin).values())[0]
if bitcoin_from_slice != bitcoin:
raise RegressionTestException("Expected cached Bitcoin to match the one from Slice")