Looking for candlestick, rsi, csv file example

6 views (last 30 days)
Normally for python and other languages, if i search such keywords candlestick+rsi+csv, i can find plenty of examples.
Now i'm learning matlab, cannot find proper samples yet, so want to start with dummy questions, pls bear with me.
i got this:
Data = readtable('/home/usr1/matlab/spy.csv')
now i want to draw the candlestick and rsi in the same figure, can someone show me a simple code to get started ?
My question is, i don't know the latest correct ways, some examples are from 2011 and won't compile in the latest matlab version.
Thanks !

Accepted Answer

Stephan
Stephan on 18 Feb 2019
Edited: Stephan on 18 Feb 2019
Hi,
here is a working example for candlestick containing .csv-data which works on R2018b:
Based on this code, the data and the Documentation of RSI it should be easy to plot the RSI.
Best regards
Stephan
  5 Comments
Stephan
Stephan on 18 Feb 2019
Edited: Stephan on 18 Feb 2019
The warning appears since there is a space in Adj Close, which is an unallowed variable name. I used the HeaderLines',1 which fixes the problem and gave the variable names by hand:
Data = readtable('qqq.csv','HeaderLines',1);
Data.Properties.VariableNames = {'Date_Time', 'Open', 'High', 'Low',...
'Close', 'Adj_Close', 'Volume'};
Data = table2timetable(Data);
candle(Data)
I think this is a pretty nice short code to get a candlestick chart...
Ning Ji
Ning Ji on 18 Feb 2019
Edited: Ning Ji on 18 Feb 2019
cool, it starts to working now.
It's a great example for python developers.
Many thanks !

Sign in to comment.

More Answers (0)

Categories

Find more on Financial Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!