Fix CurrentSlice python wrapper (#7932)

- Fix algorithm current slice, to be a python slice wrapper. Updating
  regression algorithmst status
This commit is contained in:
Martin-Molinero
2024-04-16 18:38:53 -03:00
committed by GitHub
parent 318701964c
commit 38c90d5a98
5 changed files with 54 additions and 18 deletions
@@ -48,9 +48,21 @@ class CustomDataMultiFileObjectStoreRegressionAlgorithm(QCAlgorithm):
def OnData(self, slice: Slice):
if slice.ContainsKey(self.customSymbol):
# passing symbol
customData = slice.Get(ExampleCustomData, self.customSymbol)
if customData.Price == 0:
raise Exception("Custom data price was not expected to be zero")
customData2 = self.current_slice.Get(ExampleCustomData, self.customSymbol)
if customData2.Price == 0:
raise Exception("Custom data2 price was not expected to be zero")
# accessing by symbol
customData = slice.Get(ExampleCustomData)[self.customSymbol]
if customData.Price == 0:
raise Exception("Custom data price was not expected to be zero, index access")
customData2 = self.current_slice.Get(ExampleCustomData)[self.customSymbol]
if customData2.Price == 0:
raise Exception("Custom data2 price was not expected to be zero, index access")
self.receivedData.append(customData)