Author |
Topic: Generic "Dates and Sales" list (5 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
MMikhail13 Posts: 2 Joined: Aug 17, 2010 |
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 |
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 |
Victor, thank you very match. It works.
Mikhail Iost |
||||
CChen15 Posts: 121 Joined: Jul 23, 2009 |
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 |
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 |
||||