bluematrix
Registered: Jan 2012
Posts: 131 |
08-19-12 10:06 PM
Quote from vicirek:
IB is event driven and returns 1 bar per event and the date/time field is how you can put it into desired series of bars. Usually it would be collection or array of OHLC structures or class instances or any other database design of your choice. You can index it as well because they come in order but it is always safer to check yourself by date and time if your request came back in order and complete. So when you request your bars in a separate request IB API will return all the requested bars in sequence (now up to 2000 bars per request ) one by one through the event. Then you process it there one by one.
ok thanks - but when I request the bar through assigning client.HistoricalData to a event handler - I'm only getting 1 data point - even thought I've requested 5 days worth of daily data? What am I missing? thanks
edit: here is a quick example - using the c# wrapper - when I request my historical data I expect multiple events to fire in sequence (if you say it's all event based?) or may e had some array structure. but neither is correct. I only get the first element of the sequence and nothing else.. any thoughts?
void client_HistoricalData(object sender, HistoricalDataEventArgs e)
{
MessageBox.Show(e.Date.ToString());
throw new NotImplementedException();
}
|