API Support Forum
OEC API > API Support > The API is not reporting equity contracts
Author Topic: The API is not reporting equity contracts
(4 messages, Page 1 of 1)
Moderators: VPfau
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Mar 11, 2011 @ 06:44 PM             Msg. 1 of 4
After logging in, OECClient.Contracts does not contain any equity (stock) contracts.

OECClient.ContractGroups that relate to equities, such as the Equities contract group, contains no Contract and no BaseContract objects.

How do I get equity contracts to be included in the OECClient.Contracts list?

Paul
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Mar 14, 2011 @ 10:25 AM             Msg. 2 of 4
Hello,

OECAPI loads initially only base contracts of futures, options for futures, their compounds and forex. It is done for compatibility with old software only.

You need to use one of Symbol Lookup methods to get equities http://www.openecry.com/api/api/OEC.API.OECClient.SymbolLookup_overloads.html

All results of Symbol Lookup calls are included in OECClient.Contracts list.

OEC Advanced Example shows how to use Symbol Lookup.

Victor Vins
Software Developer
MMike94
Posts: 13
Joined: Nov 19, 2009


Posted: Mar 15, 2011 @ 07:59 PM             Msg. 3 of 4
Thank you for the info Victor. I've been looking at the API documentation for SymbolLookup and SymbolLookupCriteria.

I also searched cs files in the Advanced example for both of those words, and they do not occur in the example.

Can you give me more information on how to use the various criteria Mode values (eg. AnyInclusion, SymbolStartsWith, DescriptionStartsWith, AnyStartsWith, ExactMatch)? Is it possible to specify a range with SymbolStartWith, such as any symbol starting with A thru L?

I'm assuming those modes use the SearchText property, but there is no documentation describing how.

By the way, CHM that I have (dated 3/18/2010) does not have a page for OEC.Data.SymbolLookupMode.

Thanks,
Paul

Paul
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Mar 15, 2011 @ 10:03 PM             Msg. 4 of 4
Please download the latest version of samples and CHM. We updated it last week.

The closest example of symbol lookup like we provide it is a symbol lookup of Google Finance: you are getting a small set (up to 50 right now) of symbols that starts with defined text. The goal of this functionality is to provide symbols on demand.

Victor Vins
Software Developer