Plot financial data continuously in time
Afficher commentaires plus anciens

Unfortunately couldn't find an existing topic on the following: I have different measures (e.g. returns) extracted from high frequency financial data. Stock markets run only during the day: I have a measure for each minute from 9:30 to 15:59 over different days. Data is stored in a timetable. I would like to plot the data against time in such a way that to 15:59 of day x follows 9:30 of day x+1. In this way the plot would look continuous w.r.t to the time range in which the data is available. By using plot(table.t,table.variable) i get the discontinuous series but the x axis is nicely labelled since table.t comes from a timetable object. Conversely, I would like to have a continuous plot like the one I would get with plot(table.variable), but here i am plotting the variable against its indexes, so no information about time is associated. I do NOT want to manually associate the x-axis indexes with time instances, work with xticks and xticklables to address the x axis correctly, this would not be fast to implement and intuitive plus I would end up loosing all the x axis dynamics coming from the timetable object. I think this couldn't be the right way to deal with this problem. Any suggestion on how to plot my data continuously in a simple and direct way? Thanks!
1 commentaire
dpb
le 1 Mar 2018
Well, a time axis is what it is; the time values are what they are.
I don't see any way to fool it natively to behave as if certain time periods weren't extant. (Unless there's some specialized graphing tool in the Financial Toolbox designed for the purpose; I don't have it)
All I can see is to write the functionality to go between the index and associated time and use it to write the tick labels vis ordinal position to match. With call backs and all you should be able to make it work I'd think.
Réponse acceptée
Plus de réponses (1)
Pierre Lonfat
le 12 Mar 2018
0 votes
I have exactly the same issue but on a daily basis. I don't know why Matlab adds non existing days (i.e. gaps for the days where the stocks markets are closed in my case). It would be awesome if I can get some help! You can see the question on my page !
1 commentaire
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
