21 using System.Collections.Generic;
31 private readonly
bool _implementsDetermineTargetPercent;
72 foreach (var attributeName
in new[] {
"CreateTargets",
"OnSecuritiesChanged" })
74 if (!_model.HasAttr(attributeName))
76 throw new NotImplementedException($
"IPortfolioConstructionModel.{attributeName} must be implemented. Please implement this missing method on {model.GetPythonType()}");
82 _implementsDetermineTargetPercent = model.GetPythonMethod(
"DetermineTargetPercent") !=
null;
128 return _model.InvokeMethod<
bool>(nameof(
IsRebalanceDue), insights, algorithmUtc);
147 if (!_implementsDetermineTargetPercent)