API Support Forum
OEC API > API Support > SubscribeBars returning incorrect prices
Author Topic: SubscribeBars returning incorrect prices
(4 messages, Page 1 of 1)
Moderators: VPfau
DClark1295
Posts: 15
Joined: Jan 16, 2014


Posted: Mar 24, 2014 @ 02:19 PM             Msg. 1 of 4
So I've been noticing this odd behaviour for a few days. I subscribe to receive bars like this in my oecapi_OnSymbolLookupReceived() for ESM4

oecapi.SubscribeBars(contract, DateTime.UtcNow.AddDays(-3), OEC.Data.SubscriptionType.Bar, 15);

Then at some point after data is received for a 15 min bar, I get 2 bars. The log below is for a 15min bar for 2:15pm EST on 3/24/2014. I would expect only 1 bar, but I print out where it says "Raw bar info" whats in the OEC.API.Bar[] openecryBars passed in to the function oecapi_OnBarsReceived. The last bar in the OEC bars given to my program by OEC has the same low,hi,open price. These are obviously wrong , but I dont know why OEC is giving me these bad bars. The times are UTC, so thats why they say 6pm and 6:15pm.

I printed out exactly whats coming from OEC below, so I know its not my program. Please help ! I dont want to quit OEC, but I need this resolved !

12:59:57: [OpenECry] 2 bars received for Symbol[ESM4] Type[Bar] interval[15] Updatable[True]
12:59:57: [OpenECry] Raw bar info - date:3/24/2014 6:00:00 PM close:1849.5 low:1847 open:1848.25 hi:1849.75
12:59:57: [OpenECry] Raw bar info - date:3/24/2014 6:15:00 PM close:1849.5 low:1849.5 open:1849.5 hi:1849.5

Daniel Clark
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Mar 24, 2014 @ 02:27 PM             Msg. 2 of 4
Hello. One bar is closed one, another is opening.

Victor Vins
Lead Software Developer
DClark1295
Posts: 15
Joined: Jan 16, 2014


Posted: Mar 24, 2014 @ 02:29 PM             Msg. 3 of 4
Thanks Victor.

Is the last bar always considered to be closing ? Should I just use the 1st bar ?

Seems like I should use the 1st one, but I will wait to hear from you.

Daniel Clark
DClark1295
Posts: 15
Joined: Jan 16, 2014


Posted: Mar 24, 2014 @ 03:40 PM             Msg. 4 of 4
Its the 1st bar. I will discard the 2nd bar.

Its been running great so far !

Daniel Clark