API Support Forum
OEC API > API Support > Errors on EventsTimer_Tick
Author Topic: Errors on EventsTimer_Tick
(4 messages, Page 1 of 1)
Moderators: VPfau
RAndrey3639
Posts: 2
Joined: Mar 30, 2016


Posted: Feb 13, 2017 @ 09:22 AM             Msg. 1 of 4
Hello
Sometimes get following errors:
1)
2017-02-08 17:11:48,148 [ 9] ERROR GAIN Futures: Client error.
System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at OEC.API.Contract.CompareTo(Contract other)
at System.Collections.Generic.GenericArraySortHelper`2.DepthLimitedQuickSort(TKey[] keys, TValue[] values, Int32 left, Int32 right, Int32 depthLimit)
at System.Collections.Generic.GenericArraySortHelper`2.Sort(TKey[] keys, TValue[] values, Int32 index, Int32 length, IComparer`1 comparer)
--- End of inner exception stack trace ---
at System.Collections.Generic.GenericArraySortHelper`2.Sort(TKey[] keys, TValue[] values, Int32 index, Int32 length, IComparer`1 comparer)
at System.Array.Sort[TKey,TValue](TKey[] keys, TValue[] items, Int32 index, Int32 length, IComparer`1 comparer)
at System.Array.Sort[TKey,TValue](TKey[] keys, TValue[] items, IComparer`1 comparer)
at System.Collections.Generic.SortedList`2..ctor(IDictionary`2 dictionary, IComparer`1 comparer)
at OEC.API.Core.CheckEvents()
at OEC.API.Core.VerifyConnection()
at OEC.API.OECClient.m_EventsTimer_Tick(Object sender, EventArgs e)

2)
2017-02-08 16:56:19,159 ERROR GAIN Futures: Client error.
System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Collections.Generic.SortedList`2.ValueList.CopyTo(TValue[] array, Int32 arrayIndex)
at System.Collections.Generic.SortedList`2..ctor(IDictionary`2 dictionary, IComparer`1 comparer)
at OEC.API.Core.CheckEvents()
at OEC.API.Core.VerifyConnection()
at OEC.API.OECClient.m_EventsTimer_Tick(Object sender, EventArgs e)

Thank you
Rinas Andrey
JSmith5611
Posts: 187
Joined:


Posted: Feb 13, 2017 @ 09:50 AM             Msg. 2 of 4
What version of the API are you using?
Jason Smith
RAndrey3639
Posts: 2
Joined: Mar 30, 2016


Posted: Feb 14, 2017 @ 12:31 AM             Msg. 3 of 4
3.5.14.1
Rinas Andrey
JSmith5611
Posts: 187
Joined:


Posted: Feb 15, 2017 @ 08:10 AM             Msg. 4 of 4
This bug was first fixed in Trader version 3.5.15.188.
I don't know the status of the official API releases, but you should be able to use the DLLs included with trader to eliminate the bug.
Jason Smith