[R-SIG-Finance] [R-sig-finance] Fwd: Question on multiple sessions...

Jeff Ryan jeff.a.ryan at gmail.com
Thu Feb 12 18:45:14 CET 2009


Again, in the IBrokers case:

twsCALLBACK is the main callback to the reqMktData request.

*processMsg* is the main routine to process each individual message
that comes in.

Within there are eWrapper$calls that handle the actual message
details, e.g. print to a file, do some processing, etc.

http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.R
http://code.google.com/p/ibrokers/source/browse/trunk/R/eWrapper.MktData.CSV.R

reqMktData => twsCALLBACK => processMsg => eWrapper$method [repeat in
while loop]

Using closures (as in the MktData.CSV version), or global variables,
you can keep track of last data or details that can be used for
real-time processing.

placeOrder is also available to _act_ on the processing as well.

Jeff


On Thu, Feb 12, 2009 at 11:07 AM, Daniel Cegielka
<daniel.cegielka at gmail.com> wrote:
> Jeff Ryan pisze:
>
>>
>> readBin on *nix when non-blocking will return a character(0) (or
>> whatever you request) when _nothing_ is available to read.  That is
>> testable and logical.  On Windows (this is the point related to
>> cross-platform) it returns garbage.  No way to test/etc.  Additionally
>> you are limited by nul terminated strings in R's processing.  There
>> are workarounds, but they are just that.
>>
>> This is all within the context of IBrokers mind you, other connections
>> will be different in terms of requirements.  IB uses simple
>> nul-terminated character messages.
>>
>
>
> http://code.google.com/p/ibrokers/source/browse/trunk/R/processMsg.R
>
> So if I understand this code...
>
> daniel
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list