API Support Forum
OEC API > API Support > PriceTick vs SubscriptionTick
Author Topic: PriceTick vs SubscriptionTick
(2 messages, Page 1 of 1)
Moderators: VPfau
VSiron
Posts: 5
Joined: Dec 05, 2020


Posted: Dec 15, 2020 @ 03:24 AM             Msg. 1 of 2
Hello everybody !!

I'm playing with the API, to fetch symbol price every second.
But I'm confusing with method price tick and subscription tick.
Price tick is a subscription, and send data when it want.
Subscription tick send data when I demand, so I can request it every second.
Ok, but object in return are not the same, and I need data coming from price.

What is the best way to fetch data from symbol price, every custom duration (as every second for exemple? )
SRuscak
Posts: 50
Joined: Aug 24, 2017


Posted: Jan 06, 2021 @ 11:05 AM             Msg. 2 of 2
Hello.

Are you asking about the difference between price subscriptions and tick subscriptions?https://gainfutures.com/GFAPI/html/T_GF_Api_Subscriptions_Price_IPriceSubscriptionApi.htm https://gainfutures.com/GFAPI/html/T_GF_Api_Subscriptions_Ticks_ITicksSubscriptionApi.htm
A tick is something that you would put on a graph, representing the smallest time unit, while a price subscription will give you full price data.

Probably you want to call gfClient.Subscriptions.Price.Subscribe(contractID), and listen to the PriceTick or PriceChanged events. It may not give you price data every second, but prices don't update every second anyway. When the price changes, an event will be raised.