Documentation

getData

Obtain currentX_TRADERdata

Syntax

D = getData(X,S,F)
D = getData(X,F)

Description

example

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

example

D= getData(X,F)returns data for the fieldsFfor all instruments associated with thextrdrsession object,X.

Examples

collapse all

Return the exchange and last price fields for the instrument defined inx.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 aliasPriceInstrument1.

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

Return the exchange and last price fields for all instruments associated with thextrdrsession 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 usingxtrdr.

X_TRADER instrument, specified as an instrument object created usingcreateInstrumentor aliases with fields corresponding to valid X_TRADER API options. For details, see the Trading TechnologiesX_TRADER API RTD TutorialorX_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没有一个correspondingSare fields for all instruments associated with thextrdrsession object,X.

Example:{'Exchange','Last'}

Data Types:char|cell|string

Output Arguments

collapse all

X_TRADER data, returned as a structure. For missing data,Dcontains aNaN.

Introduced in R2013a