Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

getData

Obtain current X_TRADER data

Syntax

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 Programming 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}

Related Examples

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 Programming Tutorial or X_TRADER API Class Reference.

Example: x.Instrument(1)

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

Example: {'Exchange','Last'}

Data Types: char | cell

Output Arguments

collapse all

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

Introduced in R2013a

Was this topic helpful?