API Support Forum
OEC API > Market Data > How to differentiate between ticks(trades) and bid/ask updates
Author Topic: How to differentiate between ticks(trades) and bid/ask updates
(5 messages, Page 1 of 1)
Moderators: VPfau
PNannis
Posts: 13
Joined: Apr 16, 2014


Posted: Jun 25, 2014 @ 11:30 AM             Msg. 1 of 5
In the OnPriceTick event handler how do I differentiate a "trade" (tick) vs a bid/ask update. I want an non-aggregated tick by tick feed. Just treating each callback as a tick doesn't work and ends up over-reporting the number of ticks.

Peter Nannis
VPfau
Moderator
Posts: 154
Joined:


Posted: Jun 26, 2014 @ 03:46 PM             Msg. 2 of 5
Each update is uniq and reflects changes at any property of a price. See descriptions here:
http://www.openecry.com/api/api/html/T_OEC_API_OnPriceChangedEvent.htm
http://www.openecry.com/api/api/html/T_OEC_API_Price.htm

If you need updates for bid\ask changes only you need a write some filter.

Thanks.

Vitaliy Pfau
PNannis
Posts: 13
Joined: Apr 16, 2014


Posted: Jun 26, 2014 @ 04:20 PM             Msg. 3 of 5
So between multiple 1 lot trades at the same time and price the only field that would change would be the total volume count between the events?

I tried to derive them that way but the the total volume is still being under reported.

Is the feed throttled down? (I am using the OnPriceTick event)

Please explain how I should properly identify each tick in the example above

Thanks/Peter

Peter Nannis
VPfau
Moderator
Posts: 154
Joined:


Posted: Jun 27, 2014 @ 10:31 AM             Msg. 4 of 5
Server sends as many quotes as it could.

Remarks on OnPriceTick says:
Quote: this event raised every time when price update comes, so it is recommended not to perform any CPU consuming operations (like GUI updates) in the event handler.


Probably you need OnPriceChanged event. This event could skip some price updates, if they come too often. OECTrader uses this event for quote window.

Vitaliy Pfau
PNannis
Posts: 13
Joined: Apr 16, 2014


Posted: Jun 30, 2014 @ 10:57 AM             Msg. 5 of 5
I figured it out so I am posting this reply so that others with the same issue may benefit.

To get a true streaming tick feed you need to subscribe to the price feed using the "SubscribeTicks" method (not "Subscribe") and then handle the "OnTicksReceived" event (not "OnPriceTick")

Peter Nannis