Profile Picture

Open E Cry Historical Data Plugin

Posted By eong9 8 Years Ago
Message
Posted Monday June 15 2009
I'm wondering why historical data retrieval is not included for the OEC plugin. I know the amount of data from OEC is somewhat limited, but I am only interested in minute data from the last day or so. Would it be difficult to write the historical plugin?
Posted Monday June 15 2009
We used to have historical data, but there was no way that the stream of data could be confirmed from OEC. So we dropped support since customer's were getting incomplete/incorrect data.

eong9 (6/15/2009)
I'm wondering why historical data retrieval is not included for the OEC plugin. I know the amount of data from OEC is somewhat limited, but I am only interested in minute data from the last day or so. Would it be difficult to write the historical plugin?
Posted Monday June 15 2009
Ah, this must have something to do with all the asynchronous methods in OEC's API. Still, I'd like to take a hack at this. I'm trying to do a service plugin, but am getting stumped on how to "wait" for some of these methods to finish. Could you possibly provide a code fragment to help me out? For example, how did you implement IService.Connect? The OEC API connect method has delegates, OnLoginComplete and OnLoginFailed, that will execute when the connect call has finished executing. I don't understand how to block or wait for these methods to finish in order to assign a return value for IService.Connect. Thanks in advance..
Posted Tuesday June 16 2009
You can use Application.Run() to run a message loop which will allow the callbacks to be called when the connect finishes.  The call to Run() will block until you call Application.ExitThread(), which you should do in your callback handlers.

Alternatively, you can call Application.DoEvents() to process just the currently pending messages.  You can put this in a loop to poll until one of the callbacks is called, or until too much time has passed.

I've just posted the source code for the TWS plugin which may help you, although it is socket-based instead of message-loop based, so the way it handles messages is different.

Thanks,
Daniel

Posted Monday June 22 2009
Daniel, thanks for helping me create the plugin.

As I understand it, the problem with requesting data is there is no callback handler for the OEC function requestbars to signal when all data packets have been received. There is no way to guarantee the number of packets to expect or the order in which they will arrive. In my testing, I've found the data packets arrive in chronological order with the last packet being an empty packet. The easy solution, for now, is to stop querying when a zero packet is received. I'm enclosing the working (for now) plugin in case it's useful to anyone.

Attachments
OECHist.zip (298 views, 7.00 KB)


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems