API Support Forum
OEC API > API Support > Retrieving Future Option Quotes using API Excel COM Sample
Author Topic: Retrieving Future Option Quotes using API Excel COM Sample
(1 messages, Page 1 of 1)
Moderators: VPfau
SShah5
Posts: 9
Joined: Aug 25, 2008


Posted: Mar 10, 2009 @ 05:14 PM             Msg. 1 of 1
Can't seem to be able to retrieve Future Option Quotes or DOM using API. Option Chains display in OEC Trader DEV but do not update in Excel sample file.

IE. OESH9 P700

Think:
Private api As OECAPICOM.IOECClient

Public Sub SubscribeAll(oecApi As OECAPICOM.IOECClient)
Set api = oecApi
Dim i As Integer
For i = 1 To 100
Dim Name As String
Name = Range("A" & (i + 2)).value
Dim contract As OECAPICOM.IContract
Set contract = api.Contracts.Item(Name)
If contract Is Nothing Then
Set contract = Glob.FindNearest(Name)
If Not (contract Is Nothing) Then
Range("A" & (i + 2)).value = contract.symbol
ElseIf Len(Name) > 3 Then
Name = Left(Name, Len(Name) - 2)
Dim bc As OECAPICOM.IBaseContract
Set bc = api.BaseContracts.FindBySymbol(Name)
If Not (bc Is Nothing) Then
api.RequestContracts bc
End If
End If
End If
If Not (contract Is Nothing) Then
api.Subscribe contract
Set SubscribedContracts(i) = contract
Else
Set SubscribedContracts(i) = Nothing
End If
Next
End Sub

is stripping the symbol to OE instead of OES.. not sure if the base contract works the same way for these options.

Before I recode the sample looking for best practices for this method.