1

我想load.instrumentsFinancialInstrument包中使用,从 csv 文件中的元数据创建多个仪器。

我的 csv 文件roots_test.csv名为

primary_id,description,type,exchange,currency,multiplier,initialmargin,identifiers
AD,Australian Dollar-CME(Floor+Electronic Combined),future,GLOBEX,USD,100000.00,5400,AUD

现在,如果我调用load.instruments它正确加载数据,我可以同时使用AD和来获取仪器AUD

但是现在说我想为同一仪器指定另一个标识符说AD2,怎么做?

> load.instruments(file = 'roots_test.csv', default_type="future")
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote,  :
  incomplete final line found by readTableHeader on 'roots_test.csv'
2: In future(primary_id = "AD", description = "Australian Dollar-CME(Floor+Electronic Combined)",  :
  underlying_id should only be NULL for cash-settled futures
3: In instrument(primary_id = primary_id, currency = currency, multiplier = multiplier,  :
  identifiersAUDdo not appear to be a named list

> getInstrument("AD")
primary_id   :"AD"
currency     :"USD"
multiplier   :1e+05
tick_size    : NULL
identifiers  :List of 1
 ..$ :"AUD"
type         :"future"
description  :"Australian Dollar-CME(Floor+Electronic Combined)"
exchange     :"GLOBEX"
initialmargin:5400
underlying_id: NULL

> getInstrument("AUD")
primary_id   :"AD"
currency     :"USD"
multiplier   :1e+05
tick_size    : NULL
identifiers  :List of 1
 ..$ :"AUD"
type         :"future"
description  :"Australian Dollar-CME(Floor+Electronic Combined)"
exchange     :"GLOBEX"
initialmargin:5400
underlying_id: NULL
4

0 回答 0