Hi folks,

I created a sample algo to get familiar with the QC Framework. When running the algo I a get a null value for the Insight..Magnitude attribute. The error and stack trace are shown below. Since the code came from standard classes that are part of the API I am not sure how to fix this issue. Here is the error message and stack trace. 

 

Runtime Error: MeanVarianceOptimizationPortfolioConstructionModel does not accept 'null' as Insight.Magnitude. Please checkout the selected Alpha Model specifications: MacdAlphaModel(12,26,9,Simple,Daily)
Parameter name: ZIONSystem.ArgumentNullException: MeanVarianceOptimizationPortfolioConstructionModel does not accept 'null' as Insight.Magnitude. Please checkout the selected Alpha Model specifications: MacdAlphaModel(12,26,9,Simple,Daily)
Parameter name: ZION

I have also attached the code here. There are two questions that I have. 

1. Would someone know why the Magnitude value is null and more importantly how to fix this?

2. The wizard never populated any code in the "OnData" method. So I don't even understand how this code can run as the documentation does not provide any hint how the execution happens?


from Alphas.MacdAlphaModel import MacdAlphaModel
from Execution.ImmediateExecutionModel import ImmediateExecutionModel
from Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel

class UncoupledHorizontalCoil(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)  # Set Start Date
        self.SetEndDate(2019, 1, 20) # Set End Date
        self.SetCash(100000)  # Set Strategy Cash
        
        self.SetUniverseSelection(QC500UniverseSelectionModel(filterFineData = True))
        self.SetExecution(ImmediateExecutionModel())
        self.SetPortfolioConstruction(MeanVarianceOptimizationPortfolioConstructionModel())
        self.SetRiskManagement(TrailingStopRiskManagementModel(0.08))

        self.AddAlpha(MacdAlphaModel(12, 26, 9, MovingAverageType.Simple, Resolution.Daily))


    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''

Thanks in advance for your help. Cheers,
Mitch