API Support Forum
OEC API > API Support > New OEC COM API 3.5, question re. OnContractsChanged callback
Author Topic: New OEC COM API 3.5, question re. OnContractsChanged callback
(2 messages, Page 1 of 1)
Moderators: VPfau
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: May 17, 2013 @ 04:07 PM             Msg. 1 of 2
I am working with the latest version of OEC COM API 3.5 that was released on Friday 5.10.13.

In OnContractsChanged, the first contract for a given base symbol has a name with an "@" in front of the base symbol. This is different than the older version. Is that intentional? It's fine, we can work with it either way, we just wanted to make sure something is not wrong with either our side or your side.

Here's the code that reveals this change:


_stdcall apiOEC::OnContractsChanged(LPDISPATCH/*IBaseContract*/bc)
{
OECAPICOM::IBaseContractPtr BaseContract = bc;
OECAPICOM::IContractListPtr contracts = BaseContract->GetContracts();
for(int i=0; i < contracts->Count; ++i) {
OECAPICOM::IContractPtr con = contracts->ItemByIndex(i);
std::string sym = con->Symbol;
if(sym.front() != '@')
//do something
}
}

Thanks,

CHW
VictorV
Posts: 746
Joined: May 08, 2007


Posted: May 17, 2013 @ 04:32 PM             Msg. 2 of 2
Now OECAPI provides continuous contracts too.

Victor Vins
Lead Software Developer