Using Price2Ret to calculate Return

6 Ansichten (letzte 30 Tage)
alpedhuez
alpedhuez am 8 Jul. 2018
Suppose I have a data with the first column is Date and the second column is Price. I would like to calculate Returns using price2ret and put that information on the third column. Please advise.
  3 Kommentare
alpedhuez
alpedhuez am 8 Jul. 2018
I have done this and would like to see the code sample because I would think it is a reasonable question that would be of interest.
dpb
dpb am 8 Jul. 2018
Bearbeitet: dpb am 8 Jul. 2018
Post your work...I don't have the requisite toolbox nor data to work from. Best would be a small self-contained example illustrating the problem you ran into instead of expecting volunteers to try recreate your (unknownst to us) problem scenario.
What happens with
t=readtable('sample4.xlsx');
[ret,ints]=price2ret(t.Price,t.Date);
??? Does it barf on datetime array?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Akshay Srivastava
Akshay Srivastava am 9 Jul. 2018
It will be better, if you could send the code you are working on to understand the exact need of your question and it would help in answering properly.

Kategorien

Mehr zu Time Series Objects finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by