API Support Forum
OEC API > Market Data > Advice request regarding spreads contracts, charts, and orders
Author Topic: Advice request regarding spreads contracts, charts, and orders
(9 messages, Page 1 of 1)
Moderators: VPfau
Posts: 226
Joined: Apr 24, 2012

Posted: Aug 21, 2014 @ 09:23 PM             Msg. 1 of 9
Here are some Q's and observations for you regarding Futures Spreads contracts and charts:

1) I use SymbolLookup like so:

OECAPICOM::ISymbolLookupCriteriaPtr criteria;
criteria->SearchText = "GCL";
criteria->Mode = OECAPICOM::SymbolLookupMode::SymbolLookupMode_AnyInclusion;
criteria->DesiredResultCount = 1000;
//criteria->_CompoundType = //I set this by types I want, or don't set it to get all types

This code snippet returns a max of 50 contracts, and often the contracts with nearer contract months are not returned, and many types are missing. How does OEC Trader Symbol Lookup show the nearer months first? Trader's SymbolLookup seems to return liquid contracts more often than when I call to it. How do you do that?

2) Q: Is it possible to use RequestContracts on a spreads base symbol? A: Yes. For instance, GCL FTS has 2500 contracts. I can maintain a list of desired spreads base contract symbols, request their contracts, and design a custom comparator to order the returned contracts as desired. Note: the list of spreads base contracts may change frequently, and so hard-coded lists are a disadvantage to this approach.

3) Is there a limit to the number of spreads contracts I can request, or the number of requests I can make, on a per hour or session basis? I see these properties in OECAPI()->Properties: MaxDailyContracts : 1000, MaxRequestsPerHour : 5000. I'll be testing to see if I hit any limits.

5) Is there a property to show that Spreads is enabled in an account, like the property for options? I find the property for options like so:

OECAPICOM::IPropertyListPtr pList = OECAPI()->Properties;
std::string s(pList->Item("Options"));

6) The IsSpread property reads as false for all Butterfly, Condor, Bundle, and Strip (etc) spreads. For instance, KE FB +1 U5,-2 Z5,+1 H6: KC Wheat Butterfly IsSpread property is set to false. Are these not Spreads?

7) OECAPICOM::SymbolLookupMode::SymbolLookupMode_AnyInclusion's description seems to indicate that if I ask for "GRB", I would get back this contract: GCL-GRBV4 CS -,+. However, the response doesn't include this contract. I do get 50 other GRB spreads contracts, all of which are FTS or CS. Perhaps it was just limited to 50 and did its best?

8) Is there a way to give SymbolLookup a base futures symbol like "GCL", and get back all the spreads base symbols available that involve "GCL"? I thought this code might produce the desired effect, but it didn't:
criteria->ByBaseContractsOnly = true;
9) The documentation provided at:
isometimes reverses the base symbol legs in the spreads base symbol. For instance, the base symbol for spreads contract Crude Oil Heating Oil Commodity Spread is given as GHO-GCL CS, but in OEC Trader it shows as GCL-GHO CS. The documentation is a guide to availability of contracts, and so its nice to have it be correct for those looking up spreads by the base symbol provided in the documentation.

Thanks much,
Edited by CWeber984 on Sep 22, 2014 at 18:16:08
Posts: 226
Joined: Apr 24, 2012

Posted: Sep 18, 2014 @ 04:31 PM             Msg. 2 of 9
Reduced the complexity of my posts to this thread.

Edited by CWeber984 on Sep 20, 2014 at 01:31:42
Posts: 100
Joined: Oct 26, 2011

Posted: Sep 23, 2014 @ 02:02 PM             Msg. 3 of 9

1. We fixed SymbolLookup behavior recently. Now the result is sorted by expiration time and then any restrictions applied to it.
Production system has have this fix since September 5, 2014

3. MaxDailyContracts: How many contracts you can trade daily
MaxRequestsPerHour: How many any kind requests you can send thru our system per hour

We have a server based restriction for amount of records we send back to SymbolLookup request. Now it is 50
However there are no restrictions for ContractRequest

5. Yes, the property name is "Compounds"

6. IsSpread property is true when IsCompound and legs count equals 2
We do not support this property any more. It is marked as obsolete in OECAPI

7. Yes, we have a restriction - we send back no more than top 50 contracts

8. ByBaseContractsOnly property works only with SymbolLookupMode_ExactMatch

9. OECTrader makes its own compound name based on base contract and legs provided rather than using original compound name.

Vitaliy Pfau
Posts: 226
Joined: Apr 24, 2012

Posted: Sep 24, 2014 @ 05:59 PM             Msg. 4 of 9
1. Given this fix, could we get a new build for the OECAPICOM version of the API?
8. I don't believe I'm doing the right thing here regarding getting base symbols for spreads/compounds using SymbolLookup functionality, because I don't get back contracts, let alone bases, for any base symbol when I make a SymbollLookup request as follows:

OECAPICOM::ISymbolLookupCriteriaPtr criteria;
criteria->SearchText = "GCL";
criteria->Mode = OECAPICOM::SymbolLookupMode::SymbolLookupMode_ExactMatch;
criteria->ByBaseContractsOnly = true;
criteria->DesiredResultCount = 100;
criteria->ContractKinds->Add(OECAPICOM::ContractKind::ContractKind_FutureCompound); //all futures spreads types

Thanks for your replies for the other questions, they are very helpful.

Posts: 25

Posted: Oct 01, 2014 @ 05:00 PM             Msg. 5 of 9
8. Instead of SymbolLookup, please use RequestContracts.

OECAPI()->RequestContracts(OECAPI()->BaseContracts->FindBySymbol("GCL FTS"));

Zachary Day
Posts: 226
Joined: Apr 24, 2012

Posted: Oct 01, 2014 @ 07:55 PM             Msg. 6 of 9
Thanks for posting the OECAPICOM update.