How to use function "totalreturnprice"?

11 ビュー (過去 30 日間)
AtK42
AtK42 2023 年 1 月 13 日
回答済み: Sulaymon Eshkabilov 2023 年 1 月 13 日
When trying the example for the function totalreturnprice, as given in the documentation (given below), I don't seem to understand how it works. No matter how I adjust the act or div arrays, always the same result is displayed which in my view renders the entire function useless. Thus my question, how does this function work?
Or alternatively, I am looking for a function for which I can give in three inputs: a date column, prices from a price index and dividends and or stock splits (corresponding to a certain date, obviously) and then gives me back the total return prices.
act = [732313, 2; 732314 ,2];
div = [732313, 0.0800; 732314, 0.0800];
prc = [732313, 12; 732314, 13];
prcTableDateTime=table(datetime(prc(:,1),'ConvertFrom','datenum'),prc(:,2));
acttableString=table(datestr(act(:,1)),act(:,2));
divTableNum = array2table(div);
Return = totalreturnprice(prcTableDateTime,acttableString,divTableNum)

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 1 月 13 日
To understand and see how this function works, it is better to look inside of this function. That can be achieved with the following command from the command widnow or M or MLX-file editor of MATLAB package:
edit totalreturnprice

カテゴリ

Help Center および File ExchangeFinancial Toolbox についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by