Documentation Center

  • Trial Software
  • Product Updates

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

expand all

Return Exchange and Last Price for an Instrument

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 Exchange and Last Price for an Alias

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 Exchange and Last Price for All Session Instruments

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

expand all

X — Connection objectobject structure

xtrdr connection object, specified using xtrdr.

S — Instrument objectinstrument

Instrument object created by 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)

F — Fields for the instrument objectstring | cell array of strings

Fields for the instrument object or aliases, S. 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

expand all

D — X_TRADER datastrings

X_TRADER data, returned as strings in MATLAB® and missing data is returned as NaN.

See Also

|

Was this topic helpful?