如何在'FinancialInstrument'包中使用'load.instruments'时指定其他标识符

bsint 发布于 2019-03-09 r 最后更新 2019-03-09 14:35 3 浏览

我想使用FinancialInstrument包中的load.instruments来从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,它会正确加载数据,我可以通过使用ADAUD来获取仪器。 但是现在我想为同一个仪器指定另一个标识符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
已邀请: