Correct.  You cannot initialize a portfolio that already exists.  Try
removing it in each instance with:

rm(list =ls(envir=.blotter), envir=.blotter)

This will clear your blotter environment including all portfolios and
accounts so that you can initialize them properly.

Alternatively, you can just remove the portfolio ("buyHold") but keep in
mind your Account reporting will likely hold carryover from previous runs.

Hope this helps.


Aaron




On Sun, Dec 1, 2013 at 1:27 AM, 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.
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> 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]]

