MATLAB Answers


Draw candlestick chart by reading the data in excel file.

Asked by Tai Wai ming on 1 Feb 2019
Latest activity Commented on by Tai Wai ming on 17 Feb 2019
I need some help, i downloaded some data in excel format. Any idea to draw a candlestick chart by reading the excel file?
Attached file is the example of excel data file. First to the following column of the excel file represent (Date,Time,Open,High,Low,Close,Volume).
Any idea using this information and data to draw a candlestick chart?


Sign in to comment.

1 Answer

Answer by Stephan
on 1 Feb 2019
 Accepted Answer

you can use the following code:
Data = readtable('DAT_MT_EURAUD_M1_2018.csv');
Data = mergevars(Data,[1 2]);
Data.Var1 = join(Data{:,1});
Data.Var1 = datetime(Data.Var1,'InputFormat','yyyy.MM.dd HH:mm');
Data.Properties.VariableNames = {'Date_Time', 'Open', 'High', 'Low',...
'Close', 'Volume'};
Data = table2timetable(Data);
It takes a little moment to execute, since this is a pretty big dataset. But it is working.
Best regards


Yes stephan for small set of data i try it on R2018B it work! thank you so much. But when i try to run on big set of data it prompt out that what memory error i cant screenshoot the error due to matlab crash after that. Any idea on this error?
i would suggest that you ask yourself how useful a 1-Minute Resolution may be for such a big time span.
Okay, Thanks for the help stephan i will consider about it. Thank you so much

Sign in to comment.