You can find a collection of lecture slides and associated R code for
quantstrat/blotter here:

 

http://www.r-programming.org/papers

 

Best,

 

G

 

From: r-sig-finance-bounces@r-project.org
[mailto:r-sig-finance-bounces@r-project.org] On Behalf Of W.Goutas
Sent: Monday, December 02, 2013 8:51 AM
To: Mark Knecht; GiuseppeL
Cc: r-sig-finance@r-project.org
Subject: Re: [R-SIG-Finance] quantstrat: "Error in initPortf"

 

 

Hi,

 

could someone point me where the 'quantstrat-l.Rnw' can be found?

Thanks

Wasili


Von: Mark Knecht

Gesendet: Sonntag, 1. Dezember 2013 15:32

An: GiuseppeL

Cc: r-sig-finance@r-project.org

Betreff: Re: [R-SIG-Finance] quantstrat: "Error in initPortf"

 

On Sat, Nov 30, 2013 at 10:27 PM, GiuseppeL <borsaric@gmail.com> wrote:
> Hi,I am studing Guy Yolin's examples (quantstrat-I.Rnw) and I wonder
> if someone can help me with this error message "
>
> Error in initPortf("buyHold", "SPY", initDate = "1997-12-31") :
> Portfolio buyHold already exists, use updatePortf() or
> addPortfInstr() to update it.In addition: There were 50 or more
> warnings (use warnings() to see the first 50)"
>
> Thanks.
>


Accounts and portfolios are by default stored in .blotter. Once the
code is run once the accounts exist and don't need to be created
again.

ls(.blotter)

You can break the examples into two pieces, one you run once to set
things up and a second one you run when you want to do work. Or, you
can consider adding something like

suppressWarnings(rm("account.ETF_Momentum", pos = .blotter))
suppressWarnings(rm("portfolio.Equity", pos = .blotter))
suppressWarnings(rm("portfolio.Cash", pos = .blotter))

but of course change the names to match what you (or Guy) used.

HTH,
Mark

_______________________________________________
R-SIG-Finance@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.


	[[alternative HTML version deleted]]

