API Support Forum
OEC API > API Support > Difference between Subscribe and SubscribeTicks
Author Topic: Difference between Subscribe and SubscribeTicks
(7 messages, Page 1 of 1)
Moderators: VPfau
CZendejas116
Posts: 51
Joined: Apr 13, 2011


Posted: May 24, 2011 @ 08:00 PM             Msg. 1 of 7
Hi,

Which is the dfference between subscribing for price and subscribing for ticks?
If I use method Subscribe then I receive each price (in OnPriceChanged event), for real time, but if I use method SubscribeTicks, what do I receive?

Does method SubscribeTicks provokes than OnPriceTick event get fired?

Which is the difference between OnPriceChanged and OnPriceTick?

Thank you so much in advance.

Claudia Zendejas
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 25, 2011 @ 09:46 AM             Msg. 2 of 7
Hello,

Prices include more information (bid/ask sizes, total volume, change, etc). But prices are throttled. So, you will not receive more quotes per second than some restricted by our server.
So, to receive all ticks without throttling you need to subscribe SubscribeTicks and handle OnTicksReceived event.
The difference between OnPriceChanged and OnPriceTick is a OECAPI-side throttling: if OECAPI will get two quotes in interval less than 10 msec, OnPriceChanged will be called just for second quote, but OnPriceTick will be called for both of them. 10 msec can be adjusted via http://www.openecry.com/api/api/OEC.API.OECClient.EventBatchInterval.html
CZendejas116
Posts: 51
Joined: Apr 13, 2011


Posted: May 25, 2011 @ 10:58 AM             Msg. 3 of 7
Hi,

It seems there are an answer for my question, but i cannot see it. In API Support Forum list says "Last Post by..." and no name appears.

I sitll have the question, I want to understand that difference.

Also, what is de StartDate parameter in SubscribeTicks method for?

Thank you

Claudia Zendejas
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 25, 2011 @ 05:09 PM             Msg. 4 of 7
Right, I see that my detailed reply is missing. I hope tomorrow it will be restored.

SubscribeTicks/OnTicksReceived loads historical ticks from StartDate until the current time and then will update client applciation with all real-time ticks.

Victor Vins
Software Developer
THarnett81
Posts: 78
Joined: Jan 13, 2011


Posted: May 25, 2011 @ 06:15 PM             Msg. 5 of 7
Victor, please see my post in the "Last Trade" thread. Start date does not seem to be working as you described.
CZendejas116
Posts: 51
Joined: Apr 13, 2011


Posted: May 27, 2011 @ 02:54 PM             Msg. 6 of 7
Hi Victor,

I don't know why, but I can see your answer if I search in the forum for "OnPriceTick"...
Now, thanks to you, I think I understand what about OnPriceChanged, OnPriceTick and OnTicksReceived.
We can say that OnPriceChanged and OnPriceTick provide a sampling of ticks ¿right? and OnTicksReceived provides all ticks.
Also OnPriceTick provides a larger sampling that OnPriceChanged, but still a sampling.

Thanks.


------
Hello,

Prices include more information (bid/ask sizes, total volume, change, etc). But prices are throttled. So, you will not receive more quotes per second than some restricted by our server.
So, to receive all ticks without throttling you need to subscribe SubscribeTicks and handle OnTicksReceived event.
The difference between OnPriceChanged and OnPriceTick is a OECAPI-side throttling: if OECAPI will get two quotes in interval less than 10 msec, OnPriceChanged will be called just for second quote, but OnPriceTick will be called for both of them. 10 msec can be adjusted via http://www.openecry.com/api/api/OEC.API.OECClient.EventBatchInterval.html

Claudia Zendejas
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 27, 2011 @ 02:58 PM             Msg. 7 of 7
Hello,

that's correct.

Victor Vins
Software Developer