API Support Forum
User Profile

Viewing User Profile for: TLong8876


About

Dec 29, 2015 09:23 AM

Jan 01, 2016 03:19 PM

Jan 05, 2016 05:30 AM



Post Statistics
TLong8876 has contributed to 1 posts out of 5593 total posts (0.02%) in 3049 days (0.00 posts per day).

20 most recent posts:

API Support » Empty Contact List Jan 01, 2016 @ 03:19 PM (Total replies: 1)

I am using Delphi and hence the COM interface to connect.
After successfully logging in, I can load things like base contracts and accounts but the list of specific contracts appears to be empty.
Below is the delphi code test procedure I am using and below that is the output log resulting from it.

Thanks for any help.

procedure TOECServerForm.connectToOEC(Sender: TObject);
begin
log('Trying to connect to OEC...');
OECClient1.UUID := '9e61a8bc-0a31-4542-ad85-33ebab0e4e86';
OECClient1.Connect1('api.gainfutures.com', 9200, ***, ***, true);
end;

procedure TOECServerForm.loginComplete(Sender: TObject);
begin
log('login complete');
log('contracts: ' + intToStr(OECClient1.Contracts.Count));
end;

procedure TOECServerForm.testData(Sender: TObject);
var
i: integer;
obc: BaseContract;
ibc: IContract;
icontList: IContractList;
begin
log(intToStr(OECClient1.BaseContracts.Count) + ' base contracts found');
log(intToStr(OECClient1.Contracts.Count) + ' contracts found');

obc := OECClient1.BaseContracts.FindBySymbol('ES');
OECClient1.RequestContracts(obc);

log(intToStr(OECClient1.Accounts.Count) + ' accounts found');
log('Account: ' + OECClient1.Accounts.First.Name);

log(obc.ToString);
log(obc.Name);
log(obc.Currency.Name);
log(obc.ContractGroup.Name);

ibc := OECClient1.Contracts.GetContract(1, true);
if ibc <> nil then
log(ibc.Name);

icontList := OECClient1.Contracts;
log(intToStr(icontList.Count) + ' contracts found');
end;

Log
-----

7:19:44 AM: Trying to connect to OEC...
7:19:51 AM: login complete
7:19:51 AM: contracts: 0
7:19:51 AM: 479 base contracts found
7:19:51 AM: 0 contracts found
7:19:51 AM: 1 accounts found
7:19:51 AM: Account: API002723
7:19:51 AM: ES
7:19:51 AM: E-Mini S&P
7:19:51 AM: USD
7:19:51 AM: Indices
7:19:51 AM: 0 contracts found

Thomas Long