I'm new to Matlab language and I need some help to complete one script. It's about computing continuous compounded returns from data as:
My problem is that i need to constrain it to compute returns only within selected period of time. I have dada matrix arranged as(Date format=d.m):
I do not know how to set condition such will constrain it to prevent compute returns from lag higher than highest possible remaining lag within current day.
Date, Time, Value
1.1, 1430, 1
1.1, 1431, 2
1.1, 1432, 5
1.1, 2259, 3
2.1, 1430, 8
2.1, 1431, 4
Can someone help and show me way?
Thanks for reading,