Hello,
I am trying to put my MACD consolidated 5min data into rolling window.
I've been reading the documents and other post about this but cant seem to figure it out.
When I update the rolling window im getting the data 1min at a time.
I know im adding the wrong value to the window, idk how to add the correct value which is self.macd3
Any help or advice would be greatful!
Thanks in advance!
class ParticleNadionThrustAssembly(QCAlgorithm):
def Initialize(self):
self.syl = 'FB'
self.SetStartDate(2019, 1, 1)# Set Start Date
self.SetEndDate(2019,8,30)
self.SetCash(27000) # Set Strategy Cash
self.asset = self.AddEquity(self.syl, Resolution.Minute)
self.macd_3 = self.MACD(self.syl, 3, 6, Resolution.Minute)
self.SetTimeZone('America/Chicago')
#Consolidating Data (5m)
self.fiveMinuteConsolidator = TradeBarConsolidator(timedelta(minutes=5))
self.fiveMinuteConsolidator.DataConsolidated += self.FiveMinuteBarHandler
self.SubscriptionManager.AddConsolidator(self.syl, self.fiveMinuteConsolidator)
#Macd_3 Bar Data
self.macd3 = MovingAverageConvergenceDivergence(3, 6,MovingAverageType.Exponential)
# create the 5-minutes data consolidator
fiveMinuteConsolidator = TradeBarConsolidator(timedelta(minutes=5))
self.SubscriptionManager.AddConsolidator(self.syl, fiveMinuteConsolidator)
# register the 5-minute consolidated bar data to automatically update the indicator
self.RegisterIndicator(self.syl, self.macd3, fiveMinuteConsolidator)
#macd3 5min rolling Window
def MacdUpdated(self, sender, updated):
self.macd3Win.Add(updated)