Documentation Center

  • Trial Software
  • Product Updates

createInstrument

Create instrument for X_TRADER

Syntax

Description

example

createInstrument(X,S) creates the xtrdr instrument defined by the structure 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

createInstrument(X,Name,Value) creates the instrument using one or more Name,Value pair arguments with names and values corresponding to valid X_TRADER API options. For details, see the Trading Technologies X_TRADER API Programming Tutorial or X_TRADER API Class Reference.

Examples

expand all

Create an X_TRADER Instrument Using an Input Structure

Start X_TRADER.

X = xtrdr;

Define an input structure, S, with fields corresponding to valid X_TRADER API options.

S = [];
S.Exchange = 'Eurex';
S.Product = 'OGBM';
S.ProdType = 'Option';
S.Contract = 'Jan12 P12300';
S.Alias = 'TestInstrument3';
S
S = 

    Exchange: 'Eurex'
     Product: 'OGBM'
    ProdType: 'Option'
    Contract: 'Jan12 P12300'
       Alias: 'TestInstrument3'

    Requirement:   Restart the MATLAB® session before reusing an 'Alias' setting.

    Note:   Any symbols in these examples are from an internal MathWorks® test license. These symbols do not represent real exchanges. For more information on correct symbols for the instrument, refer to Market Explorer in X_TRADER Pro.

Create an xtrdr instrument.

createInstrument(X,S);

Close the connection.

close(X)

Create an X_TRADER Instrument Using Name-Value Pairs

Start X_TRADER.

X = xtrdr;

Create an xtrdr instrument using name-value pairs corresponding to valid X_TRADER API options.

createInstrument(X,'Exchange','Eurex','Product','OGBM',...
                'ProdType','Option','Contract','Jan12 P12300',...
                'Alias','TestInstrument3');

    Requirement:   Restart the MATLAB session before reusing an 'Alias' setting.

    Note:   Any symbols in these examples are from an internal MathWorks test license. These symbols do not represent real exchanges. For more information on correct symbols for the instrument, refer to Market Explorer in X_TRADER Pro.

Close the connection.

close(X)

Input Arguments

expand all

X — Connection objectobject structure

Connection object, specified using xtrdr.

Sxtrdr input structurestructure

xtrdr input structure, specified using 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.

    Note:   If the symbols for the exchange are entered incorrectly or the exchange server is down, an error appears. For example, if the exchange is "CME" and the CME exchange server is down, then this error appears: The price server for the Exchange CME is down. Unable to create instrument.

Example: S = [];
S.Exchange = 'Eurex';
S.Product = 'OGBM';
S.ProdType = 'Option';
S.Contract = 'Jan12 P12300';
S.Alias = 'TestInstrument3';

Data Types: struct

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: createInstrument(X,'Exchange','Eurex','Product','OGBM','ProdType','Option','Contract','Jan12 P12300','Alias','TestInstrument3')

'Property1' — Valid X_TRADER API optionsstring

Valid X_TRADER API options, specified using the details described in Trading Technologies X_TRADER API Programming Tutorial or X_TRADER API Class Reference.

    Requirement:   Restart the MATLAB session before reusing an 'Alias' setting.

    Note:   When using the 'Alias' property, ensure that every 'Alias' name is unique across all X_TRADER instruments.

Data Types: char

'Property2' — Valid X_TRADER API optionsstring

Valid X_TRADER API options, specified using the details described in Trading Technologies X_TRADER API Programming Tutorial or X_TRADER API Class Reference.

Data Types: char

See Also

| | |

Was this topic helpful?