Borrar filtros
Borrar filtros

My return calculations look wrong

1 visualización (últimos 30 días)
P_Alpha
P_Alpha el 13 de Oct. de 2015
Hey everyone, I am trying to calculate the returns of stock prices, and my output from Matlab looks wrong when compared to excel. I have a 196x2 double named "TickeradjClose" where col 1 is dates, with the most recent date at the top, and column two is closing prices. My formula for calculating the return, as a decimal, is below (Sorry, it is sloppy as I am new to Matlab).
Tickerreturns=(((TickeradjClose(1:end-1,2)))-((TickeradjClose(2:end,2))))./TickeradjClose(2:end,2);
Please let me know what I am doing wrong. I have been asking some very basic questions recently, but hopefully I can pick this up as quickly as I picked up SQL and VBA so that I can begin to answer questions for others :)
Best!

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by