Address reviews
Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled

- Remove IAlphaHandler, move insight storage responsability to IResultHandler
  and centralizing insight collection on the QCAlgorithm.Insights to be
  reused by the framework models
- Fix portfolio turnover single day backtests and duplicate time
  sampling handling. Updating regression algorithms
This commit is contained in:
Martin-Molinero
2023-03-09 17:29:39 -03:00
parent 186ef5c144
commit 2ae4d1c103
99 changed files with 359 additions and 994 deletions
@@ -33,7 +33,7 @@ class InsightScoringRegressionAlgorithm(QCAlgorithm):
self.SetRiskManagement(MaximumDrawdownPercentPerSecurity(0.01))
# we specify a custom insight evaluator
self.SetInsightEvaluator(CustomInsightEvaluatorPy(self.Securities))
self.Insights.SetInsightScoreFunction(CustomInsightScoreFunction(self.Securities))
def OnEndOfAlgorithm(self):
allInsights = self.InsightManager.GetInsights()
@@ -47,7 +47,7 @@ class InsightScoringRegressionAlgorithm(QCAlgorithm):
if sum(1 for insight in allInsights if insight.Score.IsFinalScore) < 99:
raise ValueError(f'Insights not finalized!')
class CustomInsightEvaluatorPy():
class CustomInsightScoreFunction():
def __init__(self, securities):
self._securities = securities
@@ -70,6 +70,7 @@ class CustomInsightEvaluatorPy():
openInsight.EstimatedValue = score * 100
if openInsight.IsExpired(utcTime):
openInsight.Score.Finalize(utcTime)
toRemove.append(openInsight)
# clean up