API Support Forum
OEC API > API Support > Generic "Dates and Sales" list
Author Topic: Generic "Dates and Sales" list
(5 messages, Page 1 of 1)
Moderators: VPfau
MMikhail13
Posts: 2
Joined: Aug 17, 2010


Posted: Aug 18, 2010 @ 01:20 AM             Msg. 1 of 5
Hi,

I have one question about API..

How I can generic "Time and Sales" list in API?
I use OECClient.OnPriceChanged and .OnPriceTick events.
This my code:

private OEC.API.OECClient oecClient1 = new OEC.API.OECClient();
private int iTotalVol;
oecClient1.OnPriceTick += new OEC.API.OnPriceChangedEvent(oecClient1_OnPriceTick);
....
void oecClient1_OnPriceTick(OEC.API.Contract Contract, OEC.API.Price Price)
{
if (iTotalVol != Price.TotalVol)
{ listBox1.Items.Add(DateTime.Now.ToLongTimeString() + ":" + DateTime.Now.Millisecond + " Price: " + Price.LastPrice);
iTotalVol = Price.TotalVol;
dPrice = Price.LastPrice;
}
}

But,
if I compare output of this code with chart of OEC, I see difference between this...some events is not come.
Can you help me with this problem?
Thank you in advance and best regards,
Mikhail Iost.

Mikhail Iost
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Aug 18, 2010 @ 05:01 PM             Msg. 2 of 5
Hello,

you need to subscribe for ticks via OECClient.SubscribeTicks method and process OECClient.OnTicksReceived event.

OnPriceTick is intended to catch all quotes changes without throthling on client-side.

Victor Vins
Software Developer
MMikhail13
Posts: 2
Joined: Aug 17, 2010


Posted: Aug 19, 2010 @ 01:40 AM             Msg. 3 of 5
Victor, thank you very match. It works.

Mikhail Iost
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Sep 27, 2010 @ 11:52 PM             Msg. 4 of 5
Quote: OnPriceTick is intended to catch all quotes changes without throthling on client-side.

Hello, Viktor. Would you explain throttling mechanism?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Sep 28, 2010 @ 08:37 AM             Msg. 5 of 5
If client application receives more than one quotes while client code is busy, client code will receive one quote with the latest values.

Victor Vins
Software Developer