VbaFin.com

Visual Basic for Financial Professionals
Home      Reuters
The examples use 3 classes: AdxRtList for real time data, AdxRtHistory for historical data and MrvInstrument (part of DEX 1.0 Type Library) for time series. Click on the image to download all the code.
 
Main methods used are:
 
 - ListFields (AdxRtList)
 - RequestHistory (AdxRtHistory)
 - RequestTimeSeries (MrvInstrument)
 
The AdxRtList Source property set to IDN in the example might need to be set to IDN_SELECTFEED instead.

For complete information on Reuters COM libraries, classes, methods, properties and events you can contact their support team. 
 
For AdxRtList and AdxRtHistory the codes of the fields can be easily obtained by dragging and dropping any item from a Reuters Quote screen to a spreadsheet opened with Reuter’s PowerPlus.

For the MrvInstrument the fields can be obtained by using the Security History Wizard of the Reuters>Assistant menu of the PowerPlus Add in.
The GetFromReuters function retrieves data based on the Fields passed for a particular RIC. Click on the image for more examples.
 
Function GetFromReuters(ByVal RIC As String, Fields() As String)
 
    Dim appReuters As AdxRtList, Done As Boolean, i As Long, tmpArray As Variant, Loops As Long
    Const MaxLoops = 2500000
  
    Set appReuters = New AdxRtList
    appReuters.Source = "IDN"                 ' set feed name
    appReuters.RegisterItems RIC, Fields  ' perform registration
    appReuters.StartUpdates (RT_MODE_ONUPDATE)           ' ask for updates - RUNNING
    tmpArray = appReuters.ListFields(RIC, RT_FRV_ALL, RT_FCV_VALUE)
    Do
        Done = True
        For i = 0 To UBound(tmpArray)
            If Not IsNumeric(tmpArray(i, 1)) Then
                Done = False
                Exit For
            End If
        Next i
        If Done Then
            appReuters.CloseAllLinks
            appReuters.UnregisterAllItems
            Exit Do
        Else
            DoEvents
            tmpArray = appReuters.ListFields(RIC, RT_FRV_ALL, RT_FCV_VALUE)
            Loops = Loops + 1
            If Loops > MaxLoops Then Exit Do
        End If
    Loop
    Set appReuters = Nothing
    GetFromReuters = tmpArray
  
End Function