Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

rca420

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
@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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.