盖伊·约林(Guy Yollin)的QuantStrat I演讲主题 [英] Guy Yollin's QuantStrat I lecture issue

查看:174
本文介绍了盖伊·约林(Guy Yollin)的QuantStrat I演讲主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在进行Guy的quantstrat讲座(下面的链接),并且在反复尝试重新执行代码之后,我遇到了一些初始错误,这些错误使该讲座中的大多数后续代码无法正常工作./p>

这里是代码(从演讲中复制,并做了很小的改动):

rm(list=ls(all=TRUE)) #added this to delete memory

library(quantstrat)
library(blotter) #added this hoping it would rectify the errors
library(FinancialInstrument) #added this hoping it would rectify the errors

# initialize portfolio, accounts and orders
qs.strategy <- "qsFaber"
initPortf(qs.strategy, 'SPY', initDate = '1997-12-31')
initAcct(qs.strategy, portfolios = qs.strategy, initDate = '1997-12-31', initEq= 1e6)

这是我遇到的错误:

1)

> initPortf(qs.strategy, 'SPY', initDate = '1997-12-31')
Error in exists(paste("portfolio", name, sep = "."), envir = .blotter,  : 
object '.blotter' not found

2)

> initAcct(qs.strategy, portfolios = qs.strategy, initDate = '1997-12-31', initEq= 1e6)
Error in exists(paste("account", name, sep = "."), envir = .blotter, inherits = TRUE) : 
object '.blotter' not found

当我使用Windows 64位操作系统时,我不得不直接下载blotter,但是尽管复制了演讲中的代码,但我不确定为什么会出现这些错误.我的搜索结果表明,吸墨纸的一部分演变为FinancialInstrument软件包,但是即使清除了内存并加载了FinancialInstruments之后,我仍然遇到相同的错误.

任何帮助将不胜感激.

与讲座的链接: http://www.r-programming.org/文件/quantstrat-I.pdf

解决方案

Guy Yollin的论文是很好的学习材料,但不幸的是,它们有些过时了(2011年).在过去的两年中,对吸墨纸,quantstrat和其他软件包进行了许多更改,而Guy的工作表中的许多代码将不再照常运行.

就quantstrat软件包而言,您可能想看一看在芝加哥举行的R/Finance 2013大会上的工作表;您可以在 http://www.rinfinance.com/agenda上获得副本./2013/workshop/Humme+Peterson.pdf .

更新:盖·尤林(Guy Yollin)已将其幻灯片更新为截至2013年8月的最新Quantstrat,可在此处 http://www.r-programming.org/papers

I've been going through Guy's quantstrat lecture (link below) and after repeatedly attempting to re-execute the code, I'm getting a few initial errors that are preventing most of the subsequent code in the lecture from functioning.

Here is the code (copied from the lecture with very minor re-arrangements):

rm(list=ls(all=TRUE)) #added this to delete memory

library(quantstrat)
library(blotter) #added this hoping it would rectify the errors
library(FinancialInstrument) #added this hoping it would rectify the errors

# initialize portfolio, accounts and orders
qs.strategy <- "qsFaber"
initPortf(qs.strategy, 'SPY', initDate = '1997-12-31')
initAcct(qs.strategy, portfolios = qs.strategy, initDate = '1997-12-31', initEq= 1e6)

Here are the errors I am getting:

1)

> initPortf(qs.strategy, 'SPY', initDate = '1997-12-31')
Error in exists(paste("portfolio", name, sep = "."), envir = .blotter,  : 
object '.blotter' not found

2)

> initAcct(qs.strategy, portfolios = qs.strategy, initDate = '1997-12-31', initEq= 1e6)
Error in exists(paste("account", name, sep = "."), envir = .blotter, inherits = TRUE) : 
object '.blotter' not found

I had to directly download blotter as I am using Windows 64 bit, but despite copying the code from the lecture, I am unsure why I am getting those errors. My search efforts have indicated that a portion of blotter evolved into the FinancialInstrument package, but even after clearing memory and loading FinancialInstruments I am still getting the same error.

Any help would be highly appreciated.

LINK to lecture: http://www.r-programming.org/files/quantstrat-I.pdf

解决方案

The sheets by Guy Yollin are excellent learning material, but unfortunately they are somewhat outdated (2011). Many changes have been made to blotter, quantstrat and other packages over the last 2 years, and much of the code in Guy's sheets will no longer run as such.

As far as the quantstrat package is concerned, you may want to take a look at the sheets from the R/Finance 2013 conference in Chicago; you can get a copy at http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf.

UPDATE: Guy Yollin has updated his slides to the latest quantstrat as of August 2013, they are available here http://www.r-programming.org/papers

这篇关于盖伊·约林(Guy Yollin)的QuantStrat I演讲主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆