[R-SIG-Finance] variable scope with ewrapper in IBrokers

Noah Silverman noahsilverman at ucla.edu
Mon Jul 18 19:36:25 CEST 2011


Hello,

I'm looking at the iBrokers package.

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?

Thanks!


--
Noah Silverman
UCLA Department of Statistics
8117 Math Sciences Building
Los Angeles, CA 90095



More information about the R-SIG-Finance mailing list