the internal function .updatePosPL has these lines in it:

if(is.null(Prices)){
prices=getPrice(get(Symbol, envir=as.environment(.GlobalEnv)),...=...)
} else {
        prices=Prices
}

So, as it is written, you cannot pass an environment to it.  However, you
could utilize the "Prices" argument in your call to updatePortf which would
then pass those Prices into .updatePosPL

It would not be diffucult for us to add an "env" argument to both functions.

-Garrett



On Mon, Sep 12, 2011 at 6:42 PM, Brian G. Peterson <brian@braverock.com>wrote:

> passing env='whateverEnvIuse" or env=.wheteverenvIuse doesn't work?
>
> Please provide a reproducible example, per the posting guide.
>
>  - Brian
>
> On Mon, 2011-09-12 at 19:22 -0400, Charlie Friedemann wrote:
> > Greetings,
> >
> > I've been working with blotter the past couple days, and one thing
> > I've noticed is that if one calls updatePortf on a portfolio object,
> > it fails:
> >
> > Error in get(Symbol, envir=as.environment(.GlobalEnv)) : Object 'SPY'
> > not found.
> >
> > I load my daily data in a separate environment using getSymbols, and
> > I'm wondering if there is anyway to get blotter to change which
> > environment it looks for historical price data in. traceback()
> > indicates the call to updatePortf uses the getPrice function in
> > quantmod and passes the .GlobalEnv to it.
> >
> > I've tried adding the environment with the price data to the search
> > path, however that did not work.
> >
> > Does anyone know a way around this issue? I'd rather not have to keep
> > all necessary data in the global environment if possible. Thanks!
> >
> > _______________________________________________
> > 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.
>
> --
> Brian G. Peterson
> http://braverock.com/brian/
> Ph: 773-459-4973
> IM: bgpbraverock
>
> _______________________________________________
> 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]]

