Hi Jared,
Please find below the code snippet for this issue. The data is provided using rest api from database so for every timestamp whether its daily or hourly, api provides the corresponding bar. I expected the GetSource function to poll the api on hourly basis in below code snippet, but the execution comes to GetSource on daily frequency regardless of the resolution. In case, multiple bars could be parsed using the API, it would have solved the issue, but as mentioned in the document, only one data point should be provided through API.
class CustomDataStock(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020, 1, 1)
self.SetEndDate(2020, 1, 31)
self.SetCash(100000)
self.reso = Resolution.Hour
self.UniverseSettings.Resolution = self.reso
# Define the symbol and "type" of our generic data:
self.appleEquity = self.AddEquity("APPL", self.reso, Market.NSE,True,1,False).Symbol
self.apple = self.AddData(CustomStock, self.appleEquity, self.reso).Symbol
self.prices = []
class Stock(PythonData):
def GetSource(self, config, date, isLiveMode):
return SubscriptionDataSource("http://127.0.0.1:5678/AAPL/4/", SubscriptionTransportMedium.Rest)