Fixes python version of BasicTemplateFrameworkAlgorithm

Renames AlphaType for `InsightType` and `AlphaDirection` for `InsightDirection`, since these `enum` were renamed in a previsous commit.
Adds this algorithm to regression tests.
This commit is contained in:
AlexCatarino
2018-03-17 19:52:24 +00:00
parent 23f6ae209c
commit eaabaef7f9
2 changed files with 6 additions and 6 deletions
@@ -26,6 +26,7 @@ from QuantConnect.Algorithm.Framework.Portfolio import *
from QuantConnect.Algorithm.Framework.Risk import *
from QuantConnect.Algorithm.Framework.Selection import *
from QuantConnect.Algorithm.Framework.Alphas import *
from datetime import timedelta
import numpy as np
### <summary>
@@ -55,15 +56,13 @@ class BasicTemplateFrameworkAlgorithm(QCAlgorithmFramework):
# set algorithm framework models
self.PortfolioSelection = ManualPortfolioSelectionModel(symbols)
self.Alpha = ConstantAlphaModel(AlphaType.Price, AlphaDirection.Up, TimeSpan.FromMinutes(20), 0.025, None)
self.Alpha = ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(minutes = 20), 0.025, None)
self.PortfolioConstruction = SimplePortfolioConstructionModel()
self.Execution = ImmediateExecutionModel()
self.RiskManagement = NullRiskManagementModel()
# these are the default values for Execution and RiskManagement models
#self.Execution = ImmediateExecutionModel()
#self.RiskManagement = NullRiskManagementModel()
self.Debug("numpy test >>> print numpy.pi: " + str(np.pi))
def OnOrderEvent(self, orderEvent):
if orderEvent.Status == OrderStatus.Filled:
self.Debug("Purchased Stock: {0}".format(orderEvent.Symbol))
self.Debug("Purchased Stock: {0}".format(orderEvent.Symbol))