Hello,

    When trying to set a FeeTransactionModel in a QCFrameworkAlgorithm, I get this error. 

Runtime Error: NameError : name 'ConstantFeeTransactionModel' is not defined
at OnSecuritiesChanged in main.py:line 44
NameError : name 'ConstantFeeTransactionModel' is not defined

 

I am unable to attach a backtest... I guess I cannot attach backtests with runtime errors?  Here's the code:

from Alphas.ConstantAlphaModel import ConstantAlphaModel

from Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel

from Risk.NullRiskManagementModel import NullRiskManagementModel


class BasicTemplateFrameworkAlgorithm(QCAlgorithmFramework):

def Initialize(self):

# Set requested data resolution
self.UniverseSettings.Resolution = Resolution.Minute

self.SetStartDate(2018, 11, 26) #Set Start Date
self.SetEndDate(2018, 11, 27) #Set End Date
self.SetCash(100000) #Set Strategy Cash

self.SetUniverseSelection(ScheduledUniverseSelectionModel(
self.DateRules.Every(DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday),
self.TimeRules.At(4, 0),
self.SelectSymbols))

self.SetAlpha(ConstantAlphaModel(InsightType.Price, InsightDirection.Up, TimeSpan.FromMinutes(20), 0.025, None))
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
self.SetExecution(NullExecutionModel())
self.SetRiskManagement(NullRiskManagementModel())


def SelectSymbols(self, dateTime):
symbols = []
symbols.append(Symbol.Create('SPY', SecurityType.Equity, Market.USA))
return symbols


def OnOrderEvent(self, orderEvent):
if orderEvent.Status == OrderStatus.Filled:
# self.Debug("Purchased Stock: {0}".format(orderEvent.Symbol))
pass

def OnSecuritiesChanged(self, changes):
for instrument in changes.AddedSecurities:
self.Securities[instrument].FeeModel = ConstantFeeTransactionModel(0)
#self.Securities[instrument].SlippageModel = ConstantSlippageModel(0)
#self.Securities[instrument].SetDataNormalizationMode(DataNormalizationMode.Raw)