It appears there's 3 different ways to get bar data out of IB:
1) the 5 second bar event
2) aggregating together the tick data
3) requesting historical data
I'm using the java version of the API, not that it probably matters.
What I'm trying to do is make a trading system that reacts at the end of a 1min or 5min bar. I want to be sure that this data, at the time I act, is the same data that will later appear in IB historical bar data, since that's what I backtest on.
The problem I have is that watching IB charts, it's obvious that their tick data doesn't just aggregate directly to bar data over time. Oftentimes the last bar in the chart will "adjust", presumably to reflect cleaned up data from some source other than the ticks. I'm worried that the differences between this and the tick data will cause my system to mis-fire.
So what I'd really like to do is get new historical data delivered to me every 1 or 5 minutes. But the API seems to not like doing that - it appears you can't leave a historical data delivery running and just get new events every bar. So am I doing something wrong, or do I need to be aggregating the 5 second data into longer bars, or what?
1) the 5 second bar event
2) aggregating together the tick data
3) requesting historical data
I'm using the java version of the API, not that it probably matters.
What I'm trying to do is make a trading system that reacts at the end of a 1min or 5min bar. I want to be sure that this data, at the time I act, is the same data that will later appear in IB historical bar data, since that's what I backtest on.
The problem I have is that watching IB charts, it's obvious that their tick data doesn't just aggregate directly to bar data over time. Oftentimes the last bar in the chart will "adjust", presumably to reflect cleaned up data from some source other than the ticks. I'm worried that the differences between this and the tick data will cause my system to mis-fire.
So what I'd really like to do is get new historical data delivered to me every 1 or 5 minutes. But the API seems to not like doing that - it appears you can't leave a historical data delivery running and just get new events every bar. So am I doing something wrong, or do I need to be aggregating the 5 second data into longer bars, or what?