- "tick2ret" - https://www.mathworks.com/help/finance/tick2ret.html
How do I calculate log returns for prices series? i.e. what is the syntax to use the continuous method with the "tick2ret" function?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
The help documentation for tick2ret suggests that there are two methods (simple and continuous), however it doesn't provide the syntax for choosing the method used. I would like to compute returns using both methods.
0 comentarios
Respuestas (1)
Moksh
el 8 de Nov. de 2023
Editada: Moksh
el 17 de Nov. de 2023
Hi Brindha,
I understand that you are trying to use the “tick2ret” function in MATLAB for getting return for price series using “continuous” approach.
You can specify the “Method” parameter as “continuous” in the function argument while passing the input to get the required results.
Here is an example code for this:
% Example tick data
tickData = [1; 2; 3; 4; 5];
% Compute returns using the simple method
returns_simple = tick2ret(tickData);
% Compute returns using the continuous method
returns_continuous = tick2ret(tickData, 'Method', 'continuous');
display(returns_continuous);
For more information about the “tick2ret” function please refer to the following MATLAB documentation:
Hope this information helps resolve the query.
Best Regards,
Moksh Aggarwal
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!