Main Content

CreateInstrument

Create instrument forX_TRADER

描述

例子

createInstrument(C,,,,s创建x_trader®结构定义的仪器s带有对应于有效X_trader API选项的字段。有关详细信息,请参阅交易技术®x_trader API RTD教程orx_trader API类参考

例子

createInstrument(C,,,,名称,价值使用一个或多个创建乐器名称,价值对相应参数名称和值to valid X_TRADER API options. For details, see the Trading Technologiesx_trader API RTD教程orx_trader API类参考

例子

全部收缩

这instruments used in these examples continually expire. To ensure you use a current instrument, see the市场资源管理器在x_trader Pro中。

创建X_trader连接。

c = xtrdr;

定义输入结构s带有对应于有效X_trader API选项的字段。例如,创建欧元博客期货的输入结构。

s= []; s.Exchange ='eurex';S.产品='OGBM';s。ProdType ='选项';s.Contract ='1月2日P12300';s。Alias ='testInstrument3';s
S = Exchange:'eurex'产品:'ogbm'prodtype:'选项'合同:'JAN12 P12300'别名:'testInstrument3''

要求:

重新启动MATLAB®在重复使用之前会话“别名”环境。

创建X_trader仪器。

CreateInstrument(C,S)

关the connection.

关闭(c)

创建X_trader连接。

c = xtrdr;

使用与有效Xtrader API选项相对应的名称值对参数创建X_trader仪器,用于欧元bobl期货。

CreateInstrument(C,'交换',,,,'eurex',,,,'产品',,,,'OGBM',,,,...“ prodtype',,,,'选项',,,,'Contract',,,,'1月2日P12300',,,,...“别名”,,,,'testInstrument3'

关the connection.

关闭(c)

创建X_trader连接。

c = xtrdr;

使用与有效Xtrader API选项相对应的名称值对参数创建X_trader仪器,用于欧元bobl期货。

CreateInstrument(C,'交换',,,,'eurex',,,,'产品',,,,'OGBM',,,,...“ prodtype',,,,'选项',,,,'Contract',,,,'Jun14 P127',,,,...“别名”,,,,'PriceInstrumentEurex'

为CAISO NP15 EZ GEN HUB创建另一个X_Trader仪器5 MW峰值日历日实时LMP期货,使用对应于有效X_trader API选项的名称值对参数。该合同将于2014年4月到期。

CreateInstrument(C,'交换',,,,'cme',,,,'产品',,,,'2F',,,,...“ prodtype',,,,'未来',,,,'Contract',,,,'apr14',,,,...“别名”,,,,'PriceStrumentCmeApr14'

为CAISO NP15 EZ GEN HUB创建另一个X_Trader仪器5 MW峰值日历日实时LMP期货,使用对应于有效X_trader API选项的名称值对参数。该合同将于2014年10月到期。

CreateInstrument(C,'交换',,,,'cme',,,,'产品',,,,'2F',,,,...“ prodtype',,,,'未来',,,,'Contract',,,,'Oct14',,,,...“别名”,,,,'PriceStrumentCmeoct14'

检索所有三种Xtrader仪器的交换和产品标识符。

d = getData(c,{'交换',,,,'产品'})
d =交换:{3x1 cell} product:{3x1 cell}

d是包含交换and产品fields. The fields are cell arrays.

显示交换场地。

d。交换
ans = 'Eurex' 'CME' 'CME'

交换字段包含三个X_trader仪器的Eureth和CME。

关the connection.

关闭(c)

输入参数

全部收缩

x_trader连接,指定为创建的连接对象xtrdr

X_TRADER input structure, specified using fields corresponding to valid X_TRADER API options. For details, see the Trading Technologiesx_trader API RTD教程orx_trader API类参考

警告

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.

例子:s= [];
s.exchange ='eurex';
s.product ='ogbm';
s。ProdType = 'Option';
s.Contract ='Jan12 P12300';
s.alias ='testInstrument3';

数据类型:结构

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen, 在哪里姓名是参数名称和Value是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

例子:CreateInstrument(X,'Exchange','eurex','product','ogbm','prodtype','option',“合同','JAN12 p12300','jan12 p12300','slias',testInstrument3')

有效X_trader API选项,使用交易技术中的信息指定为字符向量或字符串标量x_trader API RTD教程orx_trader API类参考

要求:

  • 使用时“别名”名称值对参数,确保每个“别名”name is unique across all X_TRADER instruments.

  • 重复使用MATLAB会话“别名”姓名。

否则,CreateInstrument返回错误。

数据类型:Char|细绳

有效X_trader API选项,使用交易技术中的信息指定为字符向量或字符串标量x_trader API RTD教程orx_trader API类参考

数据类型:Char|细绳

版本历史记录

Introduced in R2013a