API Support Forum
OEC API > API Support > OnPriceChanged bid ask information
Author Topic: OnPriceChanged bid ask information
(4 messages, Page 1 of 1)
Moderators: VPfau
DStefanidis51
Posts: 2
Joined: Sep 04, 2007


Posted: Sep 04, 2007 @ 07:15 PM             Msg. 1 of 4
Hi,

I am handling the OnPriceChanged event in my application and have a question about the meaning of the data I am receiving. When I examine the Price class received on the OnPriceChanged event I can see the last traded price as well as bid ask information. The question is would it be safe to assume that when the trade took place the bid and ask prices were the ones in the Price class ? Is it maybe that the bid and ask prices are the current prices which are quite possibly different from the bid and ask prices when the trade took place. If so is there any way to find out what was the bid and ask price when a trade took place ?

Thanks,
Dimitris
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Sep 05, 2007 @ 08:50 AM             Msg. 2 of 4
the bid/ask prices are current and there is no way to find what they were at the time of last trade in the OEC API.

However, you can record bid/ask history in your application to be able to look for such data at arbitrary times.
DStefanidis51
Posts: 2
Joined: Sep 04, 2007


Posted: Sep 05, 2007 @ 10:17 AM             Msg. 3 of 4
Thanks for the quick reply. That is the direction I was currently looking at. How would you recommend recording bid/ask history in my application. Would recording the time stamp during the OnPriceTick event be sufficient ? I would prefer the time stamps coming from the server and not me creating my own cause there could definitely be discrepancies in that. My other option would be to record bid/ask history through the OnDomChanged event but I would have to create my own timestamps.
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Sep 05, 2007 @ 10:47 AM             Msg. 4 of 4
we don't provide server timestamp with price or dom updates - there's only timestamp of last trade from the exchange.
Also, there's no way to tell whether trade occured by OnPriceTick event - it is called when any value updated in Price record.

for exact trade information you need to subscribe for tick updates (SubscribeTicks), and record current bid/ask prices at the time of OnTicksReceived event, using either local or exchange timestamp.