I can't ride of an error when fitting model with quantmod
, buildModel
seems to not work and so use of tradeModel
rise error :
getSymbols('GS',src='yahoo')
q.model = specifyModel(Next(OpCl(GS)) ~ Lag(OpHi(GS),0:3))
buildModel(q.model, method='lm',training.per=c('2007-08-01','2007-09-30'))
> q.model # it seems that model is still 'None fitted' ?
quantmod object: Build date:
Model Specified:
Next(OpCl(GS)) ~ Lag(OpHi(GS), 0:3)
Model Target: Next.OpCl.GS Product: GS
Model Inputs:
Fitted Model:
None Fitted
tradeModel(q.model,plot.model=TRUE,trade.dates=c("2008-01-01","2008-12-31"))
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "NULL"