Hi Trevor,
you haven't specified the resolution of your Benchmark (SPY)
self.SetBenchmark(self.AddEquity('SPY').Symbol)
By default it gets Resolution.Minute and thus your Update() method get called every minute. In addition, you haven't specify a rebalancing method/frequency for you EqualWeightingPortfolioConstructionModel so that your algo is rebalancing the portfolio every minute. I think this explains the many insights.
When we set the Resolution of SPY to Resolution.Minute there will be only 2 insights per day.
self.spy = self.SetBenchmark(self.AddEquity('SPY', Resolution.Daily).Symbol
Is that what you were looking for?
A monthly rebalancing can be obtained by passing a rebalancing timer function to your EWPCM, for example:
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel(lambda time: Expiry.EndOfMonth(time), portfolioBias = PortfoloioBias.LongShort)
self.Settings.RebalancePortfolioOnInsightChanges = False
self.Settings.RebalancePortfolioOnSecurityChanges = False
For demonstration purposes I've changed your insight durations to Expiry.EndOfMonth and added to following lines to make sure the alpha model emit insights once a month:
# in __init__
self.month = None
# in Update():
if self.month == algorithm.Time.month: return []
self.month = algorithm.Time.month
Of course there are other ways for rebalancing available. The EWPCM can also handle a more complex rebalancing function. If you dont't want to rebalance at all just use:
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel(lambda time: None))