Main Content

getData

Obtain current X_TRADER data

Description

example

D = getData(X,S,F) returns data for the fields F for the xtrdr instrument object, S, with fields corresponding to valid X_TRADER® API options. For details, see the Trading Technologies® X_TRADER API RTD Tutorial or X_TRADER API Class Reference.

example

D = getData(X,F) returns data for the fields F for all instruments associated with the xtrdr session object, X.

Examples

collapse all

Return the exchange and last price fields for the instrument defined in x.Instrument(1).

D = getData(X,X.Instrument(1),{'Exchange','Last'})
D = 

    Exchange: {'CME'}
        Last: {'45'}

Return the exchange and last price fields for the instrument defined by the alias PriceInstrument1.

D = getData(X,'PriceInstrument1',{'Exchange','Last'})
D = 

    Exchange: {'CME'}
        Last: {'45'}

Return the exchange and last price fields for all instruments associated with the xtrdr session object, X.

D = getData(X,{'Exchange','Last'})
D = 

    Exchange: {2x1 cell}
        Last: {2x1 cell}

Input Arguments

collapse all

X_TRADER connection, specified as a connection object created using xtrdr.

X_TRADER instrument, specified as an instrument object created using createInstrument or aliases with fields corresponding to valid X_TRADER API options. For details, see the Trading Technologies X_TRADER API RTD Tutorial or X_TRADER API Class Reference.

Example: x.Instrument(1)

Fields for the instrument object or aliases, S, specified as a character vector, cell array of character vectors, string scalar, or string array. F without a corresponding S are fields for all instruments associated with the xtrdr session object, X.

Example: {'Exchange','Last'}

Data Types: char | cell | string

Output Arguments

collapse all

X_TRADER data, returned as a structure. For missing data, D contains a NaN.

Version History

Introduced in R2013a