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)?
2 views (last 30 days)
Show older comments
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?
Accepted Answer
MathWorks Support Team
on 29 Mar 2013
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 Comments
More Answers (0)
See Also
Categories
Find more on Data Preprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!