[R-SIG-Finance] variable scope with ewrapper in IBrokers
Brian G. Peterson
brian at braverock.com
Mon Jul 18 19:43:10 CEST 2011
On Mon, 2011-07-18 at 10:36 -0700, Noah Silverman wrote:
> The documentation has a nice example about copying and then modifying
> the ewrapper function to handle incoming data. This works nicely.
>
> My challenge is that I want to store some persistant values (update
> moving averages, etc.)
>
> Since ewrapper() is called for every tick by reqMktData(), I can't
> figure out the best way to keep some persistent variables.
>
> How have other people handled this?
One 'R-like' method for dealing with this would be to create an
environment to store these things in and update a variable in that
environment.
Regards,
- Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list