Author |
Topic: SubscribeBars not working? (12 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
KZetterstrom Posts: 6 Joined: Jun 22, 2011 |
I am trying to use SubscribeBars to keep updated with a contracts bar history. I have tried both:
oecClient1.SubscribeBars(contract, DateTime.Now, OEC.Data.SubscriptionType.Bar, 3); and the new overload oecClient1.SubscribeBars(contract, 41, OEC.Data.SubscriptionType.Bar, 3, false); to get 3 minute bar intervals for my OEC.API.Contract contract. With both of these calls, I am getting an oecClient1_OnBarsReceived() function to fire just ONCE, which happens immediately after my call to SubscribeBars(). Shouldn't the SubscribeBars() functions send me bars on my bar interval? I thought I would hit the oecClient1_OnBarsReceived() every 3 minutes but I am not. Please help! Thanks Kevin Zetterstrom |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
What contract do you use? Is it liquid? Actually, OnBarsReceived should be raised on every update of the last bar that can be much often than 3 minutes.
Victor Vins Lead Software Developer |
||||
KZetterstrom Posts: 6 Joined: Jun 22, 2011 |
I tried several contracts. EMU1, 6CZ1, 6JZ1, 6AZ1. A few others too. None seemed to work. I can use requestBars for these and I get the bars that way through OnBarsReceived. Thoughts?
Kevin Zetterstrom |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Could you please reproduce it and send me username, contract and timestamp of the issue? I will research the issue in server logs.
Victor Vins Lead Software Developer |
||||
KZetterstrom Posts: 6 Joined: Jun 22, 2011 |
Username: KZetterstrom
Contract: 6AZ1 Time at SubscribeBars() call: 9:02:xx Eastern Standard Time. xx is somewhere between 3-30 seconds, not exactly sure. Kevin Zetterstrom |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Nothing wrong in server logs. I've checked it in a sample program - updates are coming as expected. Could you please send me a sample code to reproduce it on my side?
Victor Vins Lead Software Developer |
||||
KZetterstrom Posts: 6 Joined: Jun 22, 2011 |
PM Sent
Kevin Zetterstrom |
||||
TDecilveo930 Posts: 7 Joined: May 11, 2011 |
Any luck? I am very confused as to why I am not hitting the OnBarsReceived function
Timothy Decilveo |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Timothy, could you please send me your code? I hope we resolved the issue with Kevin's code.
Victor Vins Lead Software Developer |
||||
TDecilveo930 Posts: 7 Joined: May 11, 2011 |
Victor, I don't know why my user name is showing up as TDecilveo930, I am logged in as KZetterstrom...
In either case, Timothy is my client, I (Kevin) am his developer. So yes, the code I sent you is still not working. Timothy Decilveo |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hmm. Did you receive my response in Private Message?
It looks like you expect than every time OnBarsReceived will be called with the whole history of bars, is it correct? Actually, it is called with new bars or just a single last bar in the case of updates. Victor Vins Lead Software Developer |
||||
TDecilveo930 Posts: 7 Joined: May 11, 2011 |
I can't figure out how to see my private messages...
But yes, I was expecting more than 1 bar in OnBarsReceived. I thought that's what the new overload for SubscribeBars would do with the Amount field, which is why I passed in 41. I thought I would get the last 40 bars. I will modify the code at some point today, run it, and let you know how that goes. Timothy Decilveo |
||||