API Support Forum
OEC API > API Support > How to use OEC.API.SymbolLookupCriteria
Author Topic: How to use OEC.API.SymbolLookupCriteria
(4 messages, Page 1 of 1)
Moderators: VPfau
TLau471
Posts: 70
Joined:


Posted: Mar 25, 2019 @ 01:09 AM             Msg. 1 of 4
When I send the following on 25th Mar 2019

With aBunchOfES
.SearchText = "GGC"
.Mode = OEC.Data.SymbolLookupMode.SymbolStartsWith
End With

GGCJ9 (Apr 2019) is not returned. Why is this so? Please advise.
TLau
SRuscak
Posts: 50
Joined: Aug 24, 2017


Posted: Mar 25, 2019 @ 12:20 PM             Msg. 2 of 4
Symbol Lookup is used for fast text-based lookups, so it will return only a subset of the total results. Probably your query is using the default of 10 results and you can get GGCJ9 by setting DesiredResultCount = 50
TLau471
Posts: 70
Joined:


Posted: Apr 28, 2019 @ 08:21 PM             Msg. 3 of 4
Hi,

It worked... until it stopped working again.
I set DesiredResultCount = 1000 but still, only 50 is returned and there is no K9 now, i.e. May 2019.

Please help. Thank you.
TLau
SRuscak
Posts: 50
Joined: Aug 24, 2017


Posted: Apr 29, 2019 @ 02:13 PM             Msg. 4 of 4
Hello,

Symbol lookup returns only a subset of total results. The maximum number of results is 50.

If the contract you want isn't being returned, you can send a more specific query. For example, try .SearchText = "GGCK" or .ContractKinds.Add(ContractKind.Future)