API Support Forum
OEC API > API Support > RequestTicks gets no response after auto-reconnect
Author Topic: RequestTicks gets no response after auto-reconnect
(2 messages, Page 1 of 1)
Moderators: VPfau
RKhan61
Posts: 2
Joined: Feb 02, 2015


Posted: Apr 04, 2016 @ 12:52 PM             Msg. 1 of 2
Hi Everyone,

The problem I'm seeing is that if I Tick Request for a certain contract, and certain time period when the "OnLoginComplete" returns after connecting to OEC/GAIN, it returns the ticks asked for using the event handler "OnTicksReceived".

public void oecClient_OnLoginComplete()
{
OEC.API.Contract c = oecClient.Contracts.First();
OEC.API.Subscription sub = oecClient.RequestTicks(c, DateTime.UtcNow.AddHours(-2), DateTime.UtcNow);
}


If the connection is broken and it auto-reconnects, then again the "OnLoginComplete" is called, which calls for the tick data the exact same as before, however, this time no ticks return and the handler "OnTicksReceived" is never called.

This does not happen if I disconnect and reconnect manually, it only happens after auto-reconnect.

Is anyone else experiencing the same issue?

*PS... I'm programming in C#.
Reza Khan
NShine
Posts: 36
Joined:


Posted: Apr 07, 2016 @ 02:52 PM             Msg. 2 of 2
Hi Reza,

Yes, there appears to be a difference in the connection properties between an initial login and an auto-reconnect that can prohibit RequestTicks() calls within the OnLoginComplete event. I will be submitting a fix shortly.