Tick by tick and open to close returns high frequency trading times series

3 views (last 30 days)
Hi there,
I need to compute the logarithmic tick by tick return from a 100 000 000 x 6 matrix. The first three columns are day count, dates in yyyymmdd format and the timestamp from the transcation.
For the log returns of the tick by tick, I used the following function:
function returns=logreturn(z);
[line,column]=size(z); %take the size of the matrix to do the log returns
r=log(z(2:i,4))-log(z(1:i-1,4));%compute log returns
For the daily returns, I want the function to compute the log return based on the price from the fourth column with the price of the last data in the same column when the day count (column one) increase by one.
Any advice?
Thanks,

Answers (0)

Categories

Find more on Financial Toolbox 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!