Why do I get an error when I specify date as one of the override options in HISTORY function in Datafeed Toolbox 4.2(R2011b)?

6 次查看(过去 30 天)
I am trying to use the blp/history function to define the override option 'BETA_OVERRIDE_START_DT'.
The date string that I have specified, '20120319', works with getdata.
For example,
d = getdata(c,'AC* MM Equity','BETA_ADJ_OVERRIDABLE',{'BETA_OVERRIDE_REL_INDEX','BETA_OVERRIDE_START_DT'},{'MEXBOL Index','20120319'});
However, when I use the same date string with the HISTORY function I get the error:
Cannot convert input into specified date string.
I am using the HISTORY function in the following manner:
d = history(c,'AC* MM Equity','BETA_ADJ_OVERRIDABLE',overrideOption2)
Where overrideOption2 is...
'BETA_OVERRIDE_REL_INDEX' 'MEXBOL Index'
'BETA_OVERRIDE_START_DT' '20120319'
Why do I get this particular error with HISTORY function?

采纳的回答

MathWorks Support Team
The error is thrown in MATLAB because the date format '20120319' is not a recognized format in MATLAB.
You can use the DATENUM function to specify the format of the date via the following code:
datenum('19.03.2012','dd.mm.yyyy')
Replace '20120319' with the above command.
MATLAB will accept the first argument as a date string represented in a format specified by the second argument.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Preprocessing 的更多信息

产品


版本

R2011b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by