API Support Forum
OEC API > API Support > GF COM API Range/Volume Bar Subscription vs History Request
Author Topic: GF COM API Range/Volume Bar Subscription vs History Request
(3 messages, Page 1 of 1)
Moderators: VPfau
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: Nov 02, 2022 @ 08:34 PM             Msg. 1 of 3
After requesting history for volume bars and range bars, we then subscribe to them.

There is an issue with the most recent bar coming back during the subscription vs the historical request. The most recent subscription, if the most recent historical bar doesn't meet the requirements, has a different bar timestamp.

Here is an example. Requesting Volume 1000 bars so that once the volume hits 1000, we get a new bar. When doing the historical request, for an example, we get a bar at 7:25 PM which is the most recent valid historical request. Then when we get the subscription request back, the first subscription has a different timestamp, in this case it is 7:32 PM. The 7:25 PM bar does not have 1000 volume yet, but the subscription came back as a different timestamp indicating a new bar.

Will you please make it so that the subscription has the same timestamp as the most current history request bar (unless the most recent history request bar has the correct volume).

This issue also happens on range bars.

Thanks
JSmith5611
Posts: 187
Joined:


Posted: May 23, 2023 @ 02:52 PM             Msg. 2 of 3
Because of the way that volume / range bars are created, that's really not possible.
They are generated based on the timestamps that are passed in (or current time if none is given)

The better way of doing this is to do the subscription first, then doing the historical request using the timestamps of the first bar you get back from the subscription (this is how trader does it)
Jason Smith
RWare2020
Posts: 206
Joined: Feb 11, 2020


Posted: May 24, 2023 @ 09:48 AM             Msg. 3 of 3
Sounds good, we will implement it that way, thank you very much.