Convert daily prices to monthly returns
Show older comments
Hi Matlab Users,
I have a time series of daily prices. I want to get prices for the first and the last trading day of a month so that I can compute monthly returns.
A_1=[C(:,1) C(:,7)]; A_1 is a matrix of dates and prices. A_M=tomonthly(A_1, 'BusDays', 1); Unfortunately, I get an error message: Undefined function 'tomonthly' for input arguments of type 'double'.
I have access to the financial toolbox and should be able to use tomonthly.
Alternatively, I could do it with the financial time series GUI but it did not import my data. I tried with an xls and a txt file. Matlab files should have the extension mat but mine only have m.
Could anyone please help me out.
Thanks a lot!
Answers (1)
Sean de Wolski
on 7 May 2013
Edited: Sean de Wolski
on 7 May 2013
First, tomonthly is a method of a fints object. Thus you first have to create an object of this type:
doc fints
If A_1 is a fints object, then do you have the Financial Toolbox installed?
You can check this by running:
ver
If it is installed, what is the full output of:
which -all tomonthly
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!