Hello

my stategy need to store status in an object to guarantee persistance across redeployments and potential crashes

class statusPair:
    def __init__(self):
        self.positionDay = ''
        self.block_long = False
        self.block_short = False

 

I've tryed to store it in object store using SaveJson method

algorithm.ObjectStore.SaveJson(self.statusKey, self.statusObj)

where self.statusObj is a statusPair object, according to the documentation usage example:

self.ObjectStore.SaveJson("key", objectValue)

but I get the following error:

 Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the SaveJson method. Please checkout the API documentation. do I need to "prepare" my object before using the saveJson Method?

could you provide an example of best practice of how to do it ?

what would be the best options among the various methods available for storing objects in objectstore?

a more detailed guide ont this topic would be of great help!

thanks