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:
@@ -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))
|
||||
Reference in New Issue
Block a user