Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 06-01-2011, 11:55 AM   #1

Join Date: Aug 2008
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Need Some Pointers in Gathering 5 Min Info from IB's API.

Hi all,

I'm in the process of coding up my trading platform using IB's API in java. My strategy looks at the previous 10 (5 minutes bar) to determine entry. I just can't figure out a way to aggregate the info from reqRealTimeBars (5 seconds interval) to a 5 minute info. I understand I need to collect 60 instances of RealTimeBars callback which I have absolutely no problem in doing, but the problem is... How the heck should I approach in storing until the 5 minute mark hits and make it into one 5 minute "bar"? Much thanks and I hope i did a good job explaining it.
rca420 is offline  
Reply With Quote
Old 06-01-2011, 12:51 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,778
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Need Some Pointers in Gathering 5 Min Info from IB's API.

Quote:
Originally Posted by rca420 »
Hi all,

I'm in the process of coding up my trading platform using IB's API in java. My strategy looks at the previous 10 (5 minutes bar) to determine entry. I just can't figure out a way to aggregate the info from reqRealTimeBars (5 seconds interval) to a 5 minute info. I understand I need to collect 60 instances of RealTimeBars callback which I have absolutely no problem in doing, but the problem is... How the heck should I approach in storing until the 5 minute mark hits and make it into one 5 minute "bar"? Much thanks and I hope i did a good job explaining it.
don't know how to do a basic routine?
you might as well download NinjaTrader (free) and start from there...
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 06-01-2011, 01:31 PM   #3

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Need Some Pointers in Gathering 5 Min Info from IB's API.

perhaps a 10x4 array 10 for the 10 bars, 4 for the OHLC. AS you get 5 second 'ticks', update OHLC as necessary. After 5 minutes shift all the elements down 1 place (or index the next element).

Tams wrote about arrays somewhere (though I think that was for easylanguage) still applicable.
BlowFish is offline  
Reply With Quote
Old 06-01-2011, 03:20 PM   #4

Join Date: Aug 2008
Posts: 2
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: Need Some Pointers in Gathering 5 Min Info from IB's API.

@Blowfish: Much thanks for your idea. I've decided to use an ArrayList instead.

@Tams: Basic to you perhaps, but your snide comment wasn't necessary.
rca420 is offline  
Reply With Quote
Old 06-02-2011, 03:46 AM   #5

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Need Some Pointers in Gathering 5 Min Info from IB's API.

Array Arraylist tom ay tow tom ahhh tow.
BlowFish is offline  
Reply With Quote
Old 06-02-2011, 07:47 AM   #6

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,778
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Need Some Pointers in Gathering 5 Min Info from IB's API.

Quote:
Originally Posted by rca420 »
@Blowfish: Much thanks for your idea. I've decided to use an ArrayList instead.

@Tams: Basic to you perhaps, but your snide comment wasn't necessary.
LOL... it is the reality, not snide.

java is not for the faint at heart.

if you cannot see the reality, and cannot take a suggestion like a mature adult, why bother asking a question on a public forum? You will waste your time banging your head against the wall until one day you wake up and a light bulb goes off and say to yourself: why didn't I listen to Tams? LOL
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
OHLC in IB's API for EXCEL amit.options Automated Trading 3 02-06-2011 11:53 AM
Any Info for MC/TS Add-ons LRSB Introduce Yourself 2 11-29-2008 05:57 PM
[Playing Wide IB's] Soultrader Trading Videos 0 02-01-2008 12:44 PM
Series 3 Info brownsfan019 E-mini Futures Trading Laboratory 1 06-27-2007 06:09 PM
L2 reading info stylelad Stock Trading Laboratory 2 04-13-2007 10:41 AM

All times are GMT -4. The time now is 11:47 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.