Author |
Topic: More Bar Data (5 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
PArnoldson Posts: 154 Joined: Oct 03, 2007 |
In the OEC Trader there is a menu item to get more data. When I have a Range chart open and I select this I do get more data. I am wanting this. Is there a call in the API to do this? My first call when requesting historical data is with the start time of a date long ago (more than I know you have history for). If I am doing this wrong let me know, or is there another method for getting more data?
A bus station is where a bus stops. A train station is where a train stops. On my desk I have a work station..... |
||||
RuslanK Posts: 69 Joined: Jun 02, 2010 |
Hello,
Yes, we have certain limitations for data requests as by history depth as well as by amount of bars/ticks. So, your idea about requesting data with the start tme of a date long ago is correct. All you need to do is re-request data from some point-in-past to the timestamp of the first bar/tick from previous results. But the more convenient way is to request data by amount. Please see this method - http://www.openecry.com/api/api/OEC.API.OECClient.RequestBars_overload_4.html As it obvious from description it allows you to request certain amount of bars. So, let's say you requested 1000 bars with 1 minute interval. Once you get it, you should make another request for another 1000 bars but using timestamp of the first bar from previous results as a value for EndDate parameter of the method. Then repeat this operation again and again until you get zero bars - that means that either we do not have any data for this contract or you have met our limitation for history depth. Unfortunately, this method doesn't work for Range/Momentum bars when IgnoreSessionBound is true, but you still can use "from/to" requests in the same way as described in the scenario above. Please let me know if you have any questions. Ruslan Kartokhin Software Developer Edited by RuslanK on Oct 31, 2011 at 14:26:37 |
||||
PArnoldson Posts: 154 Joined: Oct 03, 2007 |
So.... what you are telling me is that using RequestBars with a start time and end time will work and get me all of the data I need. ... I have tested this and I don't think it is working. The first call I do is: (ESH2 is the symbol)
RequestBars(con,2.0,40931.815972222226,SubscriptionType_Bar,5); this is to get all of the history for the 5 min. The first data that I get is for Dec 7. So that is all the history you have? that is my question. So I loaded up OEC Trader 3.5 and opened ESH2 5 minute chart) I then keep clicking to get more data and more data and more data....over and over again. This will go well beyond Dec 7th. back into November. At this point I am thinking that my way is not working. So no this method doesn't get 'All' available data. I might be able to work in the way you have described above, but this would require a re-write of the current method I am using. Can the way I am doing be fixed to get 'All' available data with the two dates? A bus station is where a bus stops. A train station is where a train stops. On my desk I have a work station..... Edited by PArnoldson on Jan 23, 2012 at 14:42:44 |
||||
RuslanK Posts: 69 Joined: Jun 02, 2010 |
Let me explain it again - we do limit data responses from our servers.
So for any bar subscription/request you can receive only 8192 bars at maximum, no matter what start date you specify. For your case - once you get data (that one started from Dec 7) - make another request for bars with EndDate = Dec 7 and same StartDate as in the previous request. Then concatenate results from both requests, if this is not enough - repeat operation from sentence above again and again until you get all data you need. This is the way how OEC Trader works. Ruslan Kartokhin Software Developer |
||||
NVerner2 Posts: 12 Joined: Apr 17, 2012 |
I am having a problem similar to what PArnoldson experienced. I tried the method that RuslanK suggested for the NQM2, and I am only able to get 5770 one-minute bars, starting from the present and extending backwards without any skipped bars. I request the bars in sets of 1000 and usually get back somewhere between 500 and 1000 bars per request, for a total of 7 requests. This is almost exactly 4 days, so it seems like some kind of arbitrary limit that is set for the server. I would like something on the order of several months of one-minute bar data on the NQ futures, which would be extremely useful for back-testing my trading algorithm. Is there any way for me to get this data?
Thanks. Nathan verner & Fred isabelle |
||||