MATLAB Answers

0

Draw candlestick chart by reading the data in excel file.

Asked by Tai Wai ming on 1 Feb 2019 at 9:08
Latest activity Commented on by Stephan
22 minutes ago
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?

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephan
on 1 Feb 2019 at 14:59
 Accepted Answer

Hi,
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);
candle(Data)
It takes a little moment to execute, since this is a pretty big dataset. But it is working.
Best regards
Stephan

  16 Comments

👍then it will work
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.

Sign in to comment.