API Support Forum
OEC API > API Support > Unable to access PortfolioMargin->Current in most recent COM api
Author Topic: Unable to access PortfolioMargin->Current in most recent COM api
(3 messages, Page 1 of 1)
Moderators: VPfau
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Feb 24, 2014 @ 03:12 PM             Msg. 1 of 3
Just updated the .dlls for the COM-based api using the most recent versions found in the OEC API COM 3.5.exe.
- got these dlls from C:\Program Files (x86)\OEC\OEC API COM 3.5\
-- API.dll, CommLib.dll, OECAPICOM.dll, ProtoSharp.core.dll

I am able to access 4 fields for Portfolio Margin:

OECAPICOM::IAccountPtr pAcct = (currentAccount);
OECAPICOM::IBalancePtr balance = pAcct->TotalBalance;
OECAPICOM::IPortfolioMarginPtr portfolioMargin = balance->PortfolioMargin;
LOGMSG_DEBUG("portfolioMargin->InitialReq: " << portfolioMargin->InitialReq << "\n");
LOGMSG_DEBUG("portfolioMargin->InitialRisk: " << portfolioMargin->InitialRisk << "\n");
LOGMSG_DEBUG("portfolioMargin->MaintenanceReq: " << portfolioMargin->MaintenanceReq << "\n");
LOGMSG_DEBUG("portfolioMargin->MaintenanceRisk: " << portfolioMargin->MaintenanceRisk << "\n");

Importantly, I am unable to access the following fields per the published api:
- from http://www.openecry.com/api/api/index.html
- No portfolioMargin->Current is available
- Thus, no PortfolioMarginValues fields are available (the return for the call portfolioMargin->Current)
- No InitialReq, InitialRisk, MaintenanceReq, MaintenanceRisk, NetOptionValue, or RiskValue
- RiskValue seems quite important to be able to access, as it is displayed in OEC Trader

If I'm correct, then the current COM version of the api will need to be updated to include these fields:
- portfolioMargin->Current
- the member fields of PortfolioMarginValues

Do you agree that I'll need a newer version of the COM api in order to access the fields for Portfolio Margin?

Thanks,

CHW
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Feb 24, 2014 @ 03:53 PM             Msg. 2 of 3
Available PortfolioMargin->InitialReq, InitialRisk, MaintenanceReq and MaintenanceRisk are identical to the same properties of PortfolioMargin->Current object in .NET version.

RiskValue will be added in the next version of OEC COM API.

For NetOptionValue - please use balance->LongCallOptionsValue + balance->LongPutOptionsValue + balance->ShortCallOptionsValue + balance->ShortPutOptionsValue

Victor Vins
Lead Software Developer
CWeber984
Posts: 226
Joined: Apr 24, 2012


Posted: Feb 24, 2014 @ 04:23 PM             Msg. 3 of 3
Much appreciated, thanks.

CHW