any convenient way to plot stock trading data without after & pre market data

4 次查看(过去 30 天)
Hi:
I have stock market data and trying to plot them, the problem I'm facing is that, I want to look at the stock intraday data in several days together. I only want to look at the price change during trading hours (9:30 am to 4:00 pm), due to the time gap (after-market hours & premarket hours) between two trading days, the plot contains a large gap as shown below, which is very low quality.
is there any convenient way to visualize the intraday data for serveral continuous days?
the test data is uploaded.
Thanks!
Yu

采纳的回答

Angelo Yeo
Angelo Yeo 2023-7-20
I'm not sure if there are any off-the-shelf ways or any equivalent easy ways to break time axis. This is because the time values are what they are.
I can only think of changing xtick labels after plotting the only price values.
websave("test.mat","https://kr.mathworks.com/matlabcentral/answers/uploaded_files/1438133/test.mat");
load("test.mat");
plot(test.price)
newTicks = floor(linspace(1, height(test), 4)); % 4 is the number of xticks to use.
xlim([1, height(test)]);
xticks(newTicks)
xticklabels(cellstr(test.dateTime(newTicks),'MMM dd, HH:mm'))
  2 个评论
Yu Li
Yu Li 2023-7-20
HI:
thank you. yes I agree, the datetime is what it is, so probably this is the best workaround so far.
If Mathworks can consider a new feature - to display the data with specified axis range in figures, that will be great.
Thanks!
Yu
Angelo Yeo
Angelo Yeo 2023-7-20
Hi Yu,
Let me report your request internally. In general, if you want to request an enhancement, you can contact Technical Support.
https://www.mathworks.com/support/contact_us.html?s_tid=hp_ff_s_support

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Transaction Cost Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by