[R-SIG-Finance] Receiving market data by iBroker and implementing strategy

ce zadig_1 at excite.com
Fri Jul 18 19:40:26 CEST 2014


you need two programs run in parallel as R is not multi threaded. check http://censix.com/download/

Part A reads real time data writes to a mmap file. 
Part B loops, checks for new data and trades . 

-----Original Message-----
From: "Eric (YEN-LIN) CHIU" [ndc24075 at gmail.com]
Date: 07/18/2014 04:31 AM
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] Receiving market data by iBroker and implementing
	strategy

My goal is to let R implement a strategy instantly when I get the right
signal(market price).

But now I am stuck at the point that when I call function "reqMktData" to
receive real-time data, I found R will be occupied unless I manually stop
it or I ask to return snapshot data.

I was wondering if anyone can provide a working example that collects real
time data through IBrokers and allows trading logic to be executed? For
instance, I would like IBroker keeps updating the market data in real time
and I can also analyse the data using R at the same time.

Even though I may be able to write a while loop to get real-time data for
the latter case, I found it very slow compared to what I want it to be
(each call of reqMktData will take a few seconds).

I have spent a few days searching for solutions and found nothing. Hope
this is not a bad question. Thank you!

	[[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at 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.



More information about the R-SIG-Finance mailing list