Borrar filtros
Borrar filtros

MFE Financial toolbox related question

3 visualizaciones (últimos 30 días)
Harsh Rob
Harsh Rob el 7 de Dic. de 2019
Respondida: Maadhav Akula el 13 de Dic. de 2019
I am trying to use Realised variance from MFE Financial toolbox - Kevin Shephard.
The function is - function [rv,rvSS]=realized_variance(price,time,timeType,samplingType,samplingInterval,subsamples)
I have put the price matrix as 1*79, time matrix as 1*79, samplingType as 'CalendarTime' and subsamples as 5.
The price matrix is just the high frequency prices of the stock.
Time matrix is in the form of unix code and has many dates.
I want to calculate the realised variance at a sampling frequency of 5 min. I have created a function for the conversion of unix code to date/number format-
function dn = unixtime_to_datenum( unix_time )
dn = unix_time/86400 + 719529;
end
I am not able to convert these datenum into 'wall', 'seconds', 'unit' for different dates with different timings and then use it in this code. (Please refer attached excel sheet)
Could someone help me with this?

Respuestas (1)

Maadhav Akula
Maadhav Akula el 13 de Dic. de 2019
From your question, I think the 'unit' format refers to Normalization of time, if that is the case you can use the unixtime format itself for Normalization as follows:
normalized_time = (unix_time - min(unix_time))/(max(unix_time) - min(unix_time));
Hope this helps!

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by