Trying to plot a candlestick chart. I keep getting an error using Candle Line 41. I am trying to do a candle stick intra day but I can't even do daily. Im not even sure if this is only daily info. Help please!

1 次查看(过去 30 天)
clc clear all; % Historic data c=yahoo; d = fetch(yahoo,'IBM','JAN/01/2008','JUN/30/2012') from=datetime('JAN/01/2008'); to=datetime('JUN/30/2012'); % Current data fetch(c,'IBM'); data=fetch(c,'IBM','Close',from,to) whos data close(c);
plot(data(:,2)) candle(data('JAN/01/2008::JUN/30/2012''Highdata')) %This is my code and it returns an error missing high,low, closing,or opening data

采纳的回答

Sudarshan Kolar
Sudarshan Kolar 2017-4-24
编辑:Sudarshan Kolar 2017-4-24
Hi David,
I understand that you are getting some errors when plotting candlestick chart. Please execute the following command and see if you get the same error:
load disney;
candle(dis_HIGH(end-20:end), dis_LOW(end-20:end), dis_CLOSE(end-20:end),...
dis_OPEN(end-20:end), 'b');
If you are not getting any errors with the above code, the issue might be related to the data being passed to the "candle" function. Please check that.
If you are getting some error with the above code, please check the following:
a) You have the financial toolbox installed (you can type "ver" in your command window and see if you have it installed)
b) Try the following command and see if this fixes the issue:
>>restoredefaultpath
>>rehash toolboxcache
>>savepath
Also, please post the exact error message for our better understanding.
Sudarshan

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Bar Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by