API Support Forum
OEC API > API Support > What symbols can I Subscribe?
Author Topic: What symbols can I Subscribe?
(4 messages, Page 1 of 1)
Moderators: VPfau
KKuzma39
Posts: 2
Joined: Dec 09, 2009


Posted: Dec 10, 2009 @ 10:18 AM             Msg. 1 of 4
Good Day!

I try to get realtime prices (FDAXZ9 for example) using OECAPICOM (in Delphi).
When I connect to sim.openecry.com I can see only currency pairs (USD/CAD for example). But when I connect to api.openecry.com I cannot see no contract.

What's wrong in my operations.?.

Sorry for my English...

Kuzma Shkaranda
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Dec 10, 2009 @ 11:45 AM             Msg. 2 of 4
Please make sure you downloaded the contracts for FDAX base contract first.
see OECClient.RequestContracts method for details.
KKuzma39
Posts: 2
Joined: Dec 09, 2009


Posted: Dec 11, 2009 @ 02:11 AM             Msg. 3 of 4
Thank you for fast reply!

Here is my code:

procedure TFTest.ComboBox1CloseUp(Sender: TObject);
Var
I:Integer;
ConractList:IContractList;
FDAX:IBaseContract;
SomeContract:IContract;
begin
FDAX:=fMain.client.BaseContracts.ItemByIndex(ComboBox1.ItemIndex);
SomeContract:=FDAX.GetNearestContract;
fMain.client.RequestContracts(FDAX);
ListBox1.Items.Clear;
ConractList:=FDAX.Contracts;
ListBox1.Items.Add(FDAX.Symbol);//Control point
for I := 0 to ConractList.Count - 1 do//Here ConractList.Count = 0
ListBox1.Items.Add(ConractList.ItemByIndex(I).Symbol);
if Assigned(SomeContract) //Not Assigned
Then ListBox1.Items.Add(SomeContract.Symbol);
end;

In comment I sign some values of variables.
In Control point I make me sure I right symbol pass throu the code.

So: It is realy FDAX basecontract, and no concret contracts it contain...

May be I mast to subscribe translation of this contracts somewhre else except my programm.?.

Kuzma Shkaranda
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Dec 11, 2009 @ 04:00 PM             Msg. 4 of 4
OEC API is asynchronous. You need to wait until contracts are downloaded and event OnContractsChanged is raised before you can see the contracts you have requested.