# region imports
from AlgorithmImports import *
# endregion
class ObjectStoreChartingAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2023, 1, 1) # Set Start Date
self.set_cash(100000) # Set Strategy Cash
self.add_equity("SPY", Resolution.MINUTE)
self.content = ''
self.sma = self.SMA("SPY", 22)
def on_data(self, data: Slice):
self.content += f'{self.sma.current.end_time},{self.sma.current.value}\n'
def on_end_of_algorithm(self):
self.object_store.save('sma_values_python', self.content)